-
-
Notifications
You must be signed in to change notification settings - Fork 32.2k
gh-123681: Check NORMALIZE_CENTURY behavior at runtime; require C99 #136022
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
base: main
Are you sure you want to change the base?
Conversation
…at the compile time It is needed to support cross-compiling. Remove macros Py_NORMALIZE_CENTURY and Py_STRFTIME_C99_SUPPORT.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If remove the C99 check in the C code, we should also remove _can_support_c99()
in Lib/_pydatetime.py
.
Look in #122272 for reasons for adding this check at first place.
self.check_strftime_y2k('Y') | ||
self.check_strftime_y2k('G') | ||
|
||
def test_strftime_y2k_c99(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should not it be decorated with cpython_only
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point! The meaning of cpython_only
is not very clear.
This test might be usable for other implementations as well, so I think it's best for other implementations to skip the test if it doesn't work for them. IMO, cpython_only
is best for things like bytecode details or sys.getsizeof
.
But, that's just my opinion of course.
This is a continuation of #128444.
CPython requires C11, so all C99 features should work.
We might need workaround if a supported platform misbehaves (hence this PR -- I want to feed the buildbots). But, IMO, any workarounds for unsupported platforms best left to the respective forks.
Serhiy's runtime check for
normalize_century
is left in; I don't know about the details there.test_strftime_y2k
fails on embedded Linux #123681