-
-
Notifications
You must be signed in to change notification settings - Fork 31.1k
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
bpo-37552 strptime/strftime return invalid results with UCRT version 17763.615 #14460
Conversation
These issues ought to be fixed in the next Windows update (end of year, about the time that 3.8 releases), though we may get a redistributable ucrtbase.dll sooner. |
Lib/test/test_strptime.py
Outdated
@@ -135,6 +135,8 @@ def test_pattern_escaping(self): | |||
"%s does not have re characters escaped properly" % | |||
pattern_string) | |||
|
|||
@unittest.skipIf(sys.platform == 'win32' and locale.getdefaultlocale()[1] == 'cp65001', |
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.
Can you add a comment referencing bpo-36511 here, so people in the future will know when it is safe to stop skipping this?
It might even be worth opening a separate BPO issue for tracking this specific thing, because issue 36511 seems like more of an omnibus issue.
@zooba You probably know more about the lifetime of Windows support here - what is the best way to communicate that it will be safe to remove this skipIf
?
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.
Agreed, a specific issue for this particular failure would be good. There was one already for the same thing (to do with passing de_DE
instead of de-DE
IIRC, which triggered the experimental/broken UTF-8 support in the UCRT) that might be okay to reuse.
I don't know how best to communicate a future time for this, especially since the UCRT may get updated down-level (in earlier releases) and certain fixes may release out of band. Probably best to just leave a comment with the current UCRT version (@paulmon?) and a reminder to verify as new updates are made.
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.
@zooba, Is this the same issue? https://bugs.python.org/issue36792
These tests aren't crashing as indicated in bpo-36792, but they do cause the Windows ARM32 buildbot to fail
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.
I created a new issue: https://bugs.python.org/issue37552 and added comments.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
I have made the requested changes; please review again. |
Thanks for making the requested changes! @pganssle: please review the changes made to this pull request. |
I believe this has been sufficiently handled, but I'll let @pganssle retract his review when he's ready. (And I'll poke him in person today to make sure he's ready ;) ) |
Lib/test/test_strptime.py
Outdated
@@ -135,6 +135,9 @@ def test_pattern_escaping(self): | |||
"%s does not have re characters escaped properly" % | |||
pattern_string) | |||
|
|||
# bpo-37552 [Windows] strptime/strftime return invalid results with UCRT version 17763.615 | |||
@unittest.skipIf(sys.platform == 'win32' and locale.getdefaultlocale()[1] == 'cp65001', |
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.
Rather than repeating the whole condition and comment several times, I'd rather see it factored out to a simple @skip_if_buggy_ucrt
decorator.
Separately, I would suggest that that decorator should actually check for one of the known bugs in the UCRT, and only skip if that bug is still present; we will forget to remove these skips later otherwise :)
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.
Those are both great ideas :)
If the Azure Pipelines PR check passes, I think this is ready for additional feedback and/or merging. |
See bpo-37552 [Windows] strptime/strftime return invalid | ||
results with UCRT version 17763.615 | ||
""" | ||
global _buggy_ucrt |
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.
This is not a particularly expensive check, right? Why cache it instead of checking each time?
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.
The caching is simple and easy to follow; I'd rather keep it than assume it's not worthwhile :)
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.
LGTM.
See bpo-37552 [Windows] strptime/strftime return invalid | ||
results with UCRT version 17763.615 | ||
""" | ||
global _buggy_ucrt |
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.
The caching is simple and easy to follow; I'd rather keep it than assume it's not worthwhile :)
Lib/test/support/__init__.py
Outdated
@@ -2501,6 +2502,27 @@ def skip_unless_symlink(test): | |||
msg = "Requires functional symlink implementation" | |||
return test if ok else unittest.skip(msg)(test) | |||
|
|||
_buggy_ucrt = None | |||
def skip_if_buggy_ucrt(test): |
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.
Since this now lives in test.support
, it might be worthwhile to mention 'time' in the name (skip_if_buggy_ucrt_strfptime
or similar).
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.
I added strftime/strptime to the skip message and skip decorator name
@pganssle: Please replace |
…17763.615 (pythonGH-14460) A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this. (cherry picked from commit 9cd39b1) Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
GH-14839 is a backport of this pull request to the 3.8 branch. |
Noooo, I forgot I left that in the PR title. Serves me right for not using automerge. |
Thanks for the PR and for promptly addressing comments, @paulmon! |
…17763.615 (GH-14460) A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this. (cherry picked from commit 9cd39b1) Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
Thanks! all of the buildbot tests for Windows ARM32 have passed passed with only warnings since this was merged. |
…17763.615 (python#14460) A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this.
…17763.615 (python#14460) A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this.
…17763.615 (python#14460) A bug in MSVC UCRT version 17763.615 (which has been fixed in newer versions) is causing test failures in some strptime/strftime tests when the default code page is c65001. This change selectively skips the tests affected by this.
Skip tests that fail because of bug in MSVC UCRT failure when the default code page is cp65001.
@zooba
https://bugs.python.org/issue36511