-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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
Changes from 2 commits
2e8cc0a
a805590
6cfcddb
323f283
ce72404
7665b54
ccde057
e8001cb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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 commentThe 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 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 commentThe reason will be displayed to describe this comment to others. Learn more. Those are both great ideas :) |
||
'issue in MSVC UCRT') | ||
def test_compile(self): | ||
# Check that compiled regex is correct | ||
found = self.time_re.compile(r"%A").match(self.locale_time.f_weekday[6]) | ||
|
@@ -365,6 +368,9 @@ def test_bad_offset(self): | |
_strptime._strptime("-01:3030", "%z") | ||
self.assertEqual("Inconsistent use of : in -01:3030", str(err.exception)) | ||
|
||
# bpo-37552 [Windows] strptime/strftime return invalid results with UCRT version 17763.615 | ||
@unittest.skipIf(sys.platform == 'win32' and locale.getdefaultlocale()[1] == 'cp65001', | ||
'issue in MSVC UCRT') | ||
def test_timezone(self): | ||
# Test timezone directives. | ||
# When gmtime() is used with %Z, entire result of strftime() is empty. | ||
|
@@ -489,6 +495,9 @@ class CalculationTests(unittest.TestCase): | |
def setUp(self): | ||
self.time_tuple = time.gmtime() | ||
|
||
# bpo-37552 [Windows] strptime/strftime return invalid results with UCRT version 17763.615 | ||
@unittest.skipIf(sys.platform == 'win32' and locale.getdefaultlocale()[1] == 'cp65001', | ||
'issue in MSVC UCRT') | ||
def test_julian_calculation(self): | ||
# Make sure that when Julian is missing that it is calculated | ||
format_string = "%Y %m %d %H %M %S %w %Z" | ||
|
@@ -498,6 +507,9 @@ def test_julian_calculation(self): | |
"Calculation of tm_yday failed; %s != %s" % | ||
(result.tm_yday, self.time_tuple.tm_yday)) | ||
|
||
# bpo-37552 [Windows] strptime/strftime return invalid results with UCRT version 17763.615 | ||
@unittest.skipIf(sys.platform == 'win32' and locale.getdefaultlocale()[1] == 'cp65001', | ||
'issue in MSVC UCRT') | ||
def test_gregorian_calculation(self): | ||
# Test that Gregorian date can be calculated from Julian day | ||
format_string = "%Y %H %M %S %w %j %Z" | ||
|
@@ -512,6 +524,9 @@ def test_gregorian_calculation(self): | |
self.time_tuple.tm_year, self.time_tuple.tm_mon, | ||
self.time_tuple.tm_mday)) | ||
|
||
# bpo-37552 [Windows] strptime/strftime return invalid results with UCRT version 17763.615 | ||
@unittest.skipIf(sys.platform == 'win32' and locale.getdefaultlocale()[1] == 'cp65001', | ||
'issue in MSVC UCRT') | ||
def test_day_of_week_calculation(self): | ||
# Test that the day of the week is calculated as needed | ||
format_string = "%Y %m %d %H %S %j %Z" | ||
|
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 ofde-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.