René's URL Explorer Experiment


Title: `datetime.strptime(dt.strftime("%c"), "%c"))` fails when year is <1000. · Issue #124529 · python/cpython · GitHub

Open Graph Title: `datetime.strptime(dt.strftime("%c"), "%c"))` fails when year is <1000. · Issue #124529 · python/cpython

X Title: `datetime.strptime(dt.strftime("%c"), "%c"))` fails when year is <1000. · Issue #124529 · python/cpython

Description: Bug report Bug description: >>> from datetime import datetime >>> datetime.strptime(datetime(1000, 1, 1).strftime("%c"), "%c") datetime.datetime(1000, 1, 1, 0, 0) >>> datetime.strptime(datetime(999, 1, 1).strftime("%c"), "%c") Traceback ...

Open Graph Description: Bug report Bug description: >>> from datetime import datetime >>> datetime.strptime(datetime(1000, 1, 1).strftime("%c"), "%c") datetime.datetime(1000, 1, 1, 0, 0) >>> datetime.strptime(datetime(999...

X Description: Bug report Bug description: >>> from datetime import datetime >>> datetime.strptime(datetime(1000, 1, 1).strftime("%c"), "%c") datetime.datetime(1000, 1, 1, 0,...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"`datetime.strptime(dt.strftime(\"%c\"), \"%c\"))` fails when year is \u003c1000.","articleBody":"# Bug report\n\n### Bug description:\n\n```python\n>>> from datetime import datetime\n>>> datetime.strptime(datetime(1000, 1, 1).strftime(\"%c\"), \"%c\")\ndatetime.datetime(1000, 1, 1, 0, 0)\n>>> datetime.strptime(datetime(999, 1, 1).strftime(\"%c\"), \"%c\")\nTraceback (most recent call last):\n  File \"\u003cpython-input-1>\", line 1, in \u003cmodule>\n    datetime.strptime(datetime(999, 1, 1).strftime(\"%c\"), \"%c\")\n    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/nlx5/Documents/Programming/Python/cpython/Lib/_strptime.py\", line 573, in _strptime_datetime\n    tt, fraction, gmtoff_fraction = _strptime(data_string, format)\n                                    ~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^\n  File \"/home/nlx5/Documents/Programming/Python/cpython/Lib/_strptime.py\", line 352, in _strptime\n    raise ValueError(\"time data %r does not match format %r\" %\n                     (data_string, format))\nValueError: time data 'Tue Jan  1 00:00:00 999' does not match format '%c'\n```\n\nDiscovered this when adding some hypothesis tests for `strptime`/`strftime`. I doubt this is a real problem anyone is going to have in the real world, but maybe.\n\nI do not know if this is locale-specific or OS specific.\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-124778\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/pganssle","@type":"Person","name":"pganssle"},"datePublished":"2024-09-25T17:59:36Z","url":"https://github.com/python/cpython/issues/124529"}

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:06d4a7b5-c82c-3463-c0eb-b10c2255eec3
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idEBCE:296654:36111B4:4802FBB:6B020974
html-safe-noncec95787ff1e5a2ebbe0108a9ed18713480ca082bb3fa61a16911eab60d1bc695e
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQkNFOjI5NjY1NDozNjExMUI0OjQ4MDJGQkI6NkIwMjA5NzQiLCJ2aXNpdG9yX2lkIjoiNTQ0ODc5NDA4MjcyMzg5MTU3MiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac4d36dca71cfe96e1174ff7ec77e490496c5765a2f08a87f46b33139e58627e58
hovercard-subject-tagissue:2548650466
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/124529/issue_layout
twitter:imagehttps://opengraph.githubassets.com/23826a01edc3b0d4a4ebdd268aea8845257f90ab05351a22b1a847c5c55a40ac/python/cpython/issues/124529
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/23826a01edc3b0d4a4ebdd268aea8845257f90ab05351a22b1a847c5c55a40ac/python/cpython/issues/124529
og:image:altBug report Bug description: >>> from datetime import datetime >>> datetime.strptime(datetime(1000, 1, 1).strftime("%c"), "%c") datetime.datetime(1000, 1, 1, 0, 0) >>> datetime.strptime(datetime(999...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamepganssle
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/124529#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F124529
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%2F124529
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/124529
Reloadhttps://github.com/python/cpython/issues/124529
Reloadhttps://github.com/python/cpython/issues/124529
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/124529
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/124529
datetime.strptime(dt.strftime("%c"), "%c")) fails when year is <1000.https://github.com/python/cpython/issues/124529#top
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/pganssle
pgansslehttps://github.com/pganssle
on Sep 25, 2024https://github.com/python/cpython/issues/124529#issue-2548650466
gh-124529: Fix _strptime to make %c/%x accept a year with fewer digits #124778https://github.com/python/cpython/pull/124778
pgansslehttps://github.com/pganssle
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Sep 25, 2024https://github.com/python/cpython/issues/124529#event-14403440606
pgansslehttps://github.com/pganssle
Date and time issues 🕰️https://github.com/orgs/python/projects/21
on Sep 25, 2024https://github.com/python/cpython/issues/124529#event-14403443327
https://github.com/terryjreedy
terryjreedyhttps://github.com/terryjreedy
on Sep 25, 2024https://github.com/python/cpython/issues/124529#issuecomment-2374846753
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 26, 2024https://github.com/python/cpython/issues/124529#issuecomment-2377957513
https://docs.python.org/3/library/datetime.html#technical-detailhttps://docs.python.org/3/library/datetime.html#technical-detail
strptime()https://docs.python.org/3/library/datetime.html#datetime.datetime.strptime
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 26, 2024https://github.com/python/cpython/issues/124529#issuecomment-2377976016
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 26, 2024https://github.com/python/cpython/issues/124529#issuecomment-2378092071
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 26, 2024https://github.com/python/cpython/issues/124529#issuecomment-2378104762
@pgansslehttps://github.com/pganssle
@terryjreedyhttps://github.com/terryjreedy
https://github.com/Mariatta
Mariattahttps://github.com/Mariatta
on Sep 26, 2024https://github.com/python/cpython/issues/124529#issuecomment-2378126642
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 27, 2024https://github.com/python/cpython/issues/124529#issuecomment-2378151770
@Mariattahttps://github.com/Mariatta
https://github.com/Mariatta
Mariattahttps://github.com/Mariatta
on Sep 27, 2024https://github.com/python/cpython/issues/124529#issuecomment-2378397057
@zuohttps://github.com/zuo
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 27, 2024https://github.com/python/cpython/issues/124529#issuecomment-2378968270
@Mariattahttps://github.com/Mariatta
https://github.com/zuo
zuohttps://github.com/zuo
on Sep 28, 2024https://github.com/python/cpython/issues/124529#issuecomment-2380651384
zuohttps://github.com/zuo
on Sep 30, 2024https://github.com/python/cpython/issues/124529#event-14447937811
pythongh-124529: Fix _strptime to make %c/%y accept year with fewer d…https://github.com/zuo/cpython/commit/ef3ec1f681eb821ca79c93ece9aa34d12be5cfd2
pythongh-124529https://github.com/python/cpython/issues/124529
ef3ec1fhttps://github.com/zuo/cpython/commit/ef3ec1f681eb821ca79c93ece9aa34d12be5cfd2
pythongh-124529: Fix _strptime to make %c/%x accept year with fewer d…https://github.com/zuo/cpython/commit/827db4591600305dc1a686ea6a71606366573cc3
pythongh-124529https://github.com/python/cpython/issues/124529
827db45https://github.com/zuo/cpython/commit/827db4591600305dc1a686ea6a71606366573cc3
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Sep 30, 2024https://github.com/python/cpython/issues/124529#issuecomment-2382576006
gh-120713https://github.com/python/cpython/issues/120713
gh-122272https://github.com/python/cpython/issues/122272
https://github.com/zuo
zuohttps://github.com/zuo
on Oct 2, 2024https://github.com/python/cpython/issues/124529#issuecomment-2387288485
@pgansslehttps://github.com/pganssle
@terryjreedyhttps://github.com/terryjreedy
@Mariattahttps://github.com/Mariatta
@serhiy-storchakahttps://github.com/serhiy-storchaka
#124778https://github.com/python/cpython/pull/124778
@terryjreedyhttps://github.com/terryjreedy
gh-120713https://github.com/python/cpython/issues/120713
gh-122272https://github.com/python/cpython/issues/122272
robustness principlehttps://en.wikipedia.org/wiki/Robustness_principle
PRhttps://github.com/python/cpython/pull/124778
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 3, 2024https://github.com/python/cpython/issues/124529#issuecomment-2390635021
https://github.com/serhiy-storchaka
serhiy-storchakahttps://github.com/serhiy-storchaka
on Oct 3, 2024https://github.com/python/cpython/issues/124529#issuecomment-2390711248
#124778https://github.com/python/cpython/pull/124778
https://github.com/zuo
zuohttps://github.com/zuo
on Oct 3, 2024https://github.com/python/cpython/issues/124529#issuecomment-2391451188
#124778https://github.com/python/cpython/pull/124778
#124778https://github.com/python/cpython/pull/124778
gh-120713https://github.com/python/cpython/issues/120713
https://github.com/zuo
zuohttps://github.com/zuo
on Oct 3, 2024https://github.com/python/cpython/issues/124529#issuecomment-2391476540
StanFromIrelandhttps://github.com/StanFromIreland
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Feb 9, 2026https://github.com/python/cpython/issues/124529#event-22653095684
https://github.com/zuo
zuohttps://github.com/zuo
on Jul 19, 2026https://github.com/python/cpython/issues/124529#issuecomment-5015996305
gh-124778https://github.com/python/cpython/pull/124778
@pgansslehttps://github.com/pganssle
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/124529
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/124529
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.