René's URL Explorer Experiment


Title: `datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'` · Issue #131434 · python/cpython · GitHub

Open Graph Title: `datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'` · Issue #131434 · python/cpython

X Title: `datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'` · Issue #131434 · python/cpython

Description: Bug report Bug description: in 3.13.2 and 3.13.1 datetime.strptime no longer raises ValueError: stray % in format '%Y %' Python 3.13.2 (main, Mar 19 2025, 01:28:14) [Clang 16.0.0 (clang-1600.0.26.6)] on Darwin >>> from datetime import da...

Open Graph Description: Bug report Bug description: in 3.13.2 and 3.13.1 datetime.strptime no longer raises ValueError: stray % in format '%Y %' Python 3.13.2 (main, Mar 19 2025, 01:28:14) [Clang 16.0.0 (clang-1600.0.26.6...

X Description: Bug report Bug description: in 3.13.2 and 3.13.1 datetime.strptime no longer raises ValueError: stray % in format '%Y %' Python 3.13.2 (main, Mar 19 2025, 01:28:14) [Clang 16.0.0 (clang-160...

Opengraph URL: https://github.com/python/cpython/issues/131434

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'`","articleBody":"# Bug report\n\n### Bug description:\n\nin 3.13.2 and 3.13.1 `datetime.strptime` no longer raises `ValueError: stray % in format '%Y %'`\n```\nPython 3.13.2 (main, Mar 19 2025, 01:28:14) [Clang 16.0.0 (clang-1600.0.26.6)] on Darwin\n>>> from datetime import datetime\n>>> datetime.strptime(\"2000 %\", \"%Y %\")\ndatetime.datetime(2000, 1, 1, 0, 0)\n```\n\nas it used to do in 3.13.0:\n```\nPython 3.13.0 (main, Mar 19 2025, 01:42:48) [Clang 16.0.0 (clang-1600.0.26.6)] on darwin\n>>> from datetime import datetime\n>>> datetime.strptime(\"2000 %\", \"%Y %\")\nTraceback (most recent call last):\n  File \"\u003cpython-input-1>\", line 1, in \u003cmodule>\n    datetime.strptime(\"2000 %\", \"%Y %\")\n    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^\n  File \"/Users/nik/.pyenv/versions/3.13.0/lib/python3.13/_strptime.py\", line 573, in _strptime_datetime\n    tt, fraction, gmtoff_fraction = _strptime(data_string, format)\n                                    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n  File \"/Users/nik/.pyenv/versions/3.13.0/lib/python3.13/_strptime.py\", line 348, in _strptime\n    raise ValueError(\"stray %% in format '%s'\" % format) from None\nValueError: stray % in format '%Y %'\n```\nand e.g. 3.10:\n```\nPython 3.10.15 (main, Nov 28 2024, 23:39:17) [Clang 16.0.0 (clang-1600.0.26.4)] on Darwin\n>>> from datetime import datetime\n>>> datetime.strptime(\"2000 %\", \"%Y %\")\nTraceback (most recent call last):\n  File \"\u003cstdin>\", line 1, in \u003cmodule>\n  File \"/Users/nik/.pyenv/versions/3.10.15/lib/python3.10/_strptime.py\", line 568, in _strptime_datetime\n    tt, fraction, gmtoff_fraction = _strptime(data_string, format)\n  File \"/Users/nik/.pyenv/versions/3.10.15/lib/python3.10/_strptime.py\", line 345, in _strptime\n    raise ValueError(\"stray %% in format '%s'\" % format) from None\nValueError: stray % in format '%Y %'\n```\n\nedit 1:\ngot the same in the latest 3.12.9 (used to work in older 3.12)\n\n### CPython versions tested on:\n\n3.13\n\n### Operating systems tested on:\n\nmacOS\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-131568\n* gh-132309\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/westandskif","@type":"Person","name":"westandskif"},"datePublished":"2025-03-18T22:47:46Z","url":"https://github.com/python/cpython/issues/131434"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:7b12e8ee-f3f0-160a-8271-b74c606be9c9
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idB0A0:785A9:43827CA:5595D8A:6B022C45
html-safe-nonce4757154b202b2c4224bc8de014725e1a294c972a01f01d170afce29a10a6cbdb
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJCMEEwOjc4NUE5OjQzODI3Q0E6NTU5NUQ4QTo2QjAyMkM0NSIsInZpc2l0b3JfaWQiOiI2NzYzNzg3OTY5MjQ2NjY5ODkzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac31c78ab7a90bb6d061508c27d79a7bd5bdaabf565c61c5dd4de415d926fb70b9
hovercard-subject-tagissue:2930019835
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/131434/issue_layout
twitter:imagehttps://opengraph.githubassets.com/3ec5e735b2a12164bfda714f056bc84485e5ec51812c0501ea14db4249ac249b/python/cpython/issues/131434
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/3ec5e735b2a12164bfda714f056bc84485e5ec51812c0501ea14db4249ac249b/python/cpython/issues/131434
og:image:altBug report Bug description: in 3.13.2 and 3.13.1 datetime.strptime no longer raises ValueError: stray % in format '%Y %' Python 3.13.2 (main, Mar 19 2025, 01:28:14) [Clang 16.0.0 (clang-1600.0.26.6...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamewestandskif
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/131434#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F131434
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F131434
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/131434
Reloadhttps://github.com/python/cpython/issues/131434
Reloadhttps://github.com/python/cpython/issues/131434
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/131434
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/131434
datetime.strptime no longer raises ValueError: stray % in format '%Y %'https://github.com/python/cpython/issues/131434#top
https://github.com/serhiy-storchaka
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/westandskif
westandskifhttps://github.com/westandskif
on Mar 18, 2025https://github.com/python/cpython/issues/131434#issue-2930019835
gh-131434: Improve error reporting for incorrect format in strptime() #131568https://github.com/python/cpython/pull/131568
[3.13] gh-131434: Improve error reporting for incorrect format in strptime() (GH-131568) #132309https://github.com/python/cpython/pull/132309
westandskifhttps://github.com/westandskif
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Mar 18, 2025https://github.com/python/cpython/issues/131434#event-16851265389
picnixzhttps://github.com/picnixz
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Mar 18, 2025https://github.com/python/cpython/issues/131434#event-16851291312
https://github.com/StanFromIreland
StanFromIrelandhttps://github.com/StanFromIreland
on Mar 20, 2025https://github.com/python/cpython/issues/131434#issuecomment-2740912470
@picnixzhttps://github.com/picnixz
cpython/Lib/_strptime.pyhttps://github.com/python/cpython/blob/b8367e7cf3d740fdc401902b502c0ef2ccc6197c/Lib/_strptime.py#L448-L449
b8367e7https://github.com/python/cpython/commit/b8367e7cf3d740fdc401902b502c0ef2ccc6197c
5f4e5b5https://github.com/python/cpython/commit/5f4e5b598cab86d5fd5727d423c9728221889ed0
@serhiy-storchakahttps://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Mar 20, 2025https://github.com/python/cpython/issues/131434#event-16918349841
encukouhttps://github.com/encukou
Date and time issues 🕰️https://github.com/orgs/python/projects/21
on Mar 21, 2025https://github.com/python/cpython/issues/131434#event-16928070369
encukouhttps://github.com/encukou
extension-modulesC modules in the Modules dirhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22extension-modules%22
on Mar 21, 2025https://github.com/python/cpython/issues/131434#event-16928073952
serhiy-storchakahttps://github.com/serhiy-storchaka
on Mar 21, 2025https://github.com/python/cpython/issues/131434#event-16934340254
pythongh-131434: Improve error reporting for incorrect format in strp…https://github.com/serhiy-storchaka/cpython/commit/802f440c0b9f90bc5fb863967a46519b76b027ca
pythongh-131434https://github.com/python/cpython/issues/131434
802f440https://github.com/serhiy-storchaka/cpython/commit/802f440c0b9f90bc5fb863967a46519b76b027ca
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Mar 21, 2025https://github.com/python/cpython/issues/131434#issuecomment-2744297142
#125406https://github.com/python/cpython/pull/125406
#131568https://github.com/python/cpython/pull/131568
serhiy-storchakahttps://github.com/serhiy-storchaka
on Mar 21, 2025https://github.com/python/cpython/issues/131434#event-16934762980
pythongh-131434: Improve error reporting for incorrect format in strp…https://github.com/serhiy-storchaka/cpython/commit/4bff833d6f08c044659b1df8c80ef82d74fd02d6
pythongh-131434https://github.com/python/cpython/issues/131434
4bff833https://github.com/serhiy-storchaka/cpython/commit/4bff833d6f08c044659b1df8c80ef82d74fd02d6
duaneghttps://github.com/duaneg
on Mar 22, 2025https://github.com/python/cpython/issues/131434#event-16938194820
pythongh-131434: trailing % in strptime format strings should raise a…https://github.com/duaneg/cpython/commit/8c386e06bdd3e4655586fd16fe1a8dafdf1ecfc3
pythongh-131434https://github.com/python/cpython/issues/131434
8c386e0https://github.com/duaneg/cpython/commit/8c386e06bdd3e4655586fd16fe1a8dafdf1ecfc3
https://github.com/duaneg
duaneghttps://github.com/duaneg
on Mar 22, 2025https://github.com/python/cpython/issues/131434#issuecomment-2744936404
serhiy-storchakahttps://github.com/serhiy-storchaka
on Apr 9, 2025https://github.com/python/cpython/issues/131434#event-17186862692
gh-131434: Improve error reporting for incorrect format in strptime() (…https://github.com/python/cpython/commit/3feac7a093b3fcd549c5dc54277f26f585f2ab0c
gh-131434https://github.com/python/cpython/issues/131434
…https://github.com/python/cpython/pull/131568
3feac7ahttps://github.com/python/cpython/commit/3feac7a093b3fcd549c5dc54277f26f585f2ab0c
miss-islingtonhttps://github.com/miss-islington
on Apr 9, 2025https://github.com/python/cpython/issues/131434#event-17186864512
pythongh-131434: Improve error reporting for incorrect format in strp…https://github.com/miss-islington/cpython/commit/0d82905199cf2b5dc0fbcd0ce7d9902f11a15591
pythongh-131434https://github.com/python/cpython/issues/131434
0d82905https://github.com/miss-islington/cpython/commit/0d82905199cf2b5dc0fbcd0ce7d9902f11a15591
serhiy-storchakahttps://github.com/serhiy-storchaka
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Apr 9, 2025https://github.com/python/cpython/issues/131434#event-17186879854
github-project-automationhttps://github.com/apps/github-project-automation
Date and time issues 🕰️https://github.com/orgs/python/projects/21
on Apr 9, 2025https://github.com/python/cpython/issues/131434
serhiy-storchakahttps://github.com/serhiy-storchaka
on Apr 9, 2025https://github.com/python/cpython/issues/131434#event-17187180321
[3.13] gh-131434: Improve error reporting for incorrect format in str…https://github.com/python/cpython/commit/e2d13b42ff049469b3dd6f99d708fe02b7fc75df
gh-131434https://github.com/python/cpython/issues/131434
e2d13b4https://github.com/python/cpython/commit/e2d13b42ff049469b3dd6f99d708fe02b7fc75df
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/131434
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/131434
serhiy-storchakahttps://github.com/serhiy-storchaka
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
Date and time issues 🕰️https://github.com/orgs/python/projects/21
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.