-
-
Notifications
You must be signed in to change notification settings - Fork 32.1k
test_strptime
fails when time.strftime
does not support %Z
format string
#121782
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Which ones did you try? |
@CharlieZhao95, do you remember which C library this was? |
Thanks for the reminder, I missed the last message :) I was working on a new unix-like embedded OS that uses musllibc. Now I think this case is more related to OS, maybe DST information is missing on the OS caused this error. And this is stated in the doc, I'm not sure if we should fix it. See also: musllibc strftime %Z case 'Z':
if (tm->tm_isdst < 0) {
*l = 0;
return "";
}
fmt = __tm_to_tzname(tm);
goto string;
... |
A new OS! Exciting ❤️ But, on a new OS, you will generally need to skip a few tests, or patch things here and there. I'll close the issue—remove it from CPython's TODO list. We can reopen if you send a PR. |
Uh oh!
There was an error while loading. Please reload this page.
Bug report
Bug description:
As time.strftime doc says:
Some C libraries may replace
%Z
with a null character, which may causetest_strptime.CalculationTests
to fail. For example:In my opinion, removing the deprecated
%Z
fromformat_string
variable will not affect those tests.Similar tests that may fail:
test_strptime.CalculationTests.test_day_of_week_calculation
test_strptime.CalculationTests.test_gregorian_calculation
test_strptime.CalculationTests.test_julian_calculation
test_time.TimeTestCase.test_strptime
CPython versions tested on:
3.12
Operating systems tested on:
Linux
Linked PRs
%Z
directive in strftime-related tests #135200The text was updated successfully, but these errors were encountered: