Skip to content

gh-141540: Improve strptime error message for unconverted data - #157832

Merged
StanFromIreland merged 5 commits into
python:mainfrom
vasiliyk:gh-141540-strptime
Sep 21, 2026
Merged

StanFromIreland merged 5 commits into
python:mainfrom
vasiliyk:gh-141540-strptime

Conversation

@vasiliyk

@vasiliyk vasiliyk commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

The "unconverted data remains" error message used %s, so a trailing newline in the input was not visible.
Use !r instead, and format the neighbouring messages in _strptime() the same way.

Comment thread Lib/_strptime.py Outdated
Comment thread Lib/_strptime.py Outdated
Comment thread Misc/NEWS.d/next/Library/2026-09-19-20-31-58.gh-issue-141540.phc605.rst Outdated
Comment thread Misc/NEWS.d/next/Library/2026-09-19-20-31-58.gh-issue-141540.phc605.rst Outdated
@StanFromIreland
StanFromIreland merged commit 9816914 into python:main Sep 21, 2026
52 checks passed
@vasiliyk
vasiliyk deleted the gh-141540-strptime branch September 21, 2026 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants