Skip to content
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

Merged
merged 8 commits into from
Jul 18, 2019

Conversation

paulmon
Copy link
Contributor

@paulmon paulmon commented Jun 28, 2019

Skip tests that fail because of bug in MSVC UCRT failure when the default code page is cp65001.

@zooba

https://bugs.python.org/issue36511

@zooba
Copy link
Member

zooba commented Jun 28, 2019

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.

@@ -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',
Copy link
Member

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?

Copy link
Member

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.

Copy link
Contributor Author

@paulmon paulmon Jul 10, 2019

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

Copy link
Contributor Author

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.

@bedevere-bot
Copy link

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. I will then notify any core developers who have left a review that you're ready for them to take another look at this pull request.

@paulmon paulmon changed the title bpo-36511 skip strptime/strftime cp65001 failures bpo-37552 strptime/strftime return invalid results with UCRT version 17763.615 Jul 10, 2019
@paulmon
Copy link
Contributor Author

paulmon commented Jul 10, 2019

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@pganssle: please review the changes made to this pull request.

@zooba
Copy link
Member

zooba commented Jul 11, 2019

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 ;) )

@@ -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',
Copy link
Member

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 :)

Copy link
Contributor Author

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 :)

@paulmon
Copy link
Contributor Author

paulmon commented Jul 17, 2019

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
Copy link
Member

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?

Copy link
Member

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 :)

@pganssle pganssle dismissed their stale review July 17, 2019 14:18

Comments addressed.

Copy link
Member

@zware zware left a 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
Copy link
Member

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 :)

@@ -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):
Copy link
Member

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).

Copy link
Contributor Author

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 pganssle merged commit 9cd39b1 into python:master Jul 18, 2019
@miss-islington
Copy link
Contributor

Thanks @paulmon for the PR, and @pganssle for merging it 🌮🎉.. I'm working now to backport this PR to: 3.8.
🐍🍒⛏🤖

@bedevere-bot
Copy link

@pganssle: Please replace # with GH- in the commit message next time. Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Jul 18, 2019
…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>
@bedevere-bot
Copy link

GH-14839 is a backport of this pull request to the 3.8 branch.

@pganssle
Copy link
Member

@pganssle: Please replace # with GH- in the commit message next time. Thanks!

Noooo, I forgot I left that in the PR title. Serves me right for not using automerge.

@pganssle
Copy link
Member

Thanks for the PR and for promptly addressing comments, @paulmon!

miss-islington added a commit that referenced this pull request Jul 18, 2019
…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>
@paulmon
Copy link
Contributor Author

paulmon commented Jul 19, 2019

Thanks! all of the buildbot tests for Windows ARM32 have passed passed with only warnings since this was merged.

@paulmon paulmon deleted the buildbot_time branch August 12, 2019 20:06
lisroach pushed a commit to lisroach/cpython that referenced this pull request Sep 10, 2019
…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.
DinoV pushed a commit to DinoV/cpython that referenced this pull request Jan 14, 2020
…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.
websurfer5 pushed a commit to websurfer5/cpython that referenced this pull request Jul 20, 2020
…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.
@paulmon paulmon mannequin mentioned this pull request May 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants