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-35066: Make trailing percent test more portable. #15907

Merged
merged 1 commit into from Sep 11, 2019
Merged

bpo-35066: Make trailing percent test more portable. #15907

merged 1 commit into from Sep 11, 2019

Conversation

benjaminp
Copy link
Contributor

@benjaminp benjaminp commented Sep 11, 2019

Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.

https://bugs.python.org/issue35066

Automerge-Triggered-By: @pganssle

Automerge-Triggered-By: @pganssle

@pganssle pganssle added 🤖 automerge and removed 🤖 automerge labels Sep 11, 2019
@@ -1456,8 +1456,11 @@ def test_strftime_trailing_percent(self):
_time.strftime('%')
except ValueError:
self.skipTest('time module does not support trailing %')
self.assertEqual(t.strftime('%'), '%')
self.assertEqual(t.strftime("m:%m d:%d y:%y %"), "m:03 d:02 y:05 %")
self.assertEqual(t.strftime('%'), _time.strftime('%'), t.timetuple())
Copy link
Member

@pganssle pganssle Sep 11, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
self.assertEqual(t.strftime('%'), _time.strftime('%'), t.timetuple())
self.assertEqual(t.strftime('%'), _time.strftime('%', t.timetuple()))

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Sep 11, 2019

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

And if you don't make the requested changes, you will be poked with soft cushions!

Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
@benjaminp
Copy link
Contributor Author

@benjaminp benjaminp commented Sep 11, 2019

@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Sep 11, 2019

Thanks for making the requested changes!

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

@bedevere-bot bedevere-bot requested a review from pganssle Sep 11, 2019
@pganssle pganssle added the 🤖 automerge label Sep 11, 2019
@pganssle
Copy link
Member

@pganssle pganssle commented Sep 11, 2019

Per conversation at the core dev sprint - I'm mildly uncomfortable about changing this because the aspiration is that this behavior should work on all platforms, and we should probably set platform-specific expected failures instead of changing this, but practically speaking, this might break a bunch of platforms while we're not really prepared to actually create a platform-independent version of this, so for now I agree that we should do this more-portable version of the test. 😞

@benjaminp benjaminp merged commit f2173ae into python:master Sep 11, 2019
4 of 5 checks passed
@benjaminp benjaminp deleted the datetime-trailing-percent branch Sep 11, 2019
@miss-islington
Copy link
Contributor

@miss-islington miss-islington commented Sep 11, 2019

Thanks @benjaminp for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8.
🐍🍒🤖 I'm not a witch! I'm not a witch!

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 11, 2019
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
(cherry picked from commit f2173ae)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Sep 11, 2019

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

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Sep 11, 2019
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
(cherry picked from commit f2173ae)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
@bedevere-bot
Copy link

@bedevere-bot bedevere-bot commented Sep 11, 2019

GH-15916 is a backport of this pull request to the 3.7 branch.

miss-islington added a commit that referenced this issue Sep 11, 2019
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
(cherry picked from commit f2173ae)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
miss-islington added a commit that referenced this issue Sep 11, 2019
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
(cherry picked from commit f2173ae)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
vrpolakatcisco pushed a commit to vrpolakatcisco/cpython that referenced this issue Sep 12, 2019
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
DinoV pushed a commit to DinoV/cpython that referenced this issue Sep 12, 2019
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
websurfer5 pushed a commit to websurfer5/cpython that referenced this issue Jul 20, 2020
Different libc implementations have different behavior when presented with trailing % in strftime strings. To make test_strftime_trailing_percent more portable, compare the output of datetime.strftime directly to that of time.strftime rather than hardcoding.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA signed 🤖 automerge skip news
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants