Skip to content

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

Merged
benjaminp merged 1 commit into
python:masterfrom
benjaminp:datetime-trailing-percent
Sep 11, 2019
Merged

bpo-35066: Make trailing percent test more portable.#15907
benjaminp merged 1 commit into
python:masterfrom
benjaminp:datetime-trailing-percent

Conversation

@benjaminp

@benjaminp benjaminp commented Sep 11, 2019

Copy link
Copy Markdown
Contributor

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

Comment thread Lib/test/datetimetester.py Outdated

Copy link
Copy Markdown
Member

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
Copy Markdown

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

benjaminp commented Sep 11, 2019 via email

Copy link
Copy Markdown
Contributor Author

@bedevere-bot

Copy link
Copy Markdown

Thanks for making the requested changes!

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

@pganssle

Copy link
Copy Markdown
Member

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
@benjaminp
benjaminp deleted the datetime-trailing-percent branch September 11, 2019 10:50
@miss-islington

Copy link
Copy Markdown
Contributor

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 pull request 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
Copy Markdown

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 pull request 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
Copy Markdown

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

miss-islington added a commit that referenced this pull request 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 pull request 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>
DinoV pushed a commit to DinoV/cpython that referenced this pull request 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 pull request 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants