René's URL Explorer Experiment


Title: datetime.fromisoformat incorrectly accepts and parses strings without date-time separator · Issue #107779 · python/cpython · GitHub

Open Graph Title: datetime.fromisoformat incorrectly accepts and parses strings without date-time separator · Issue #107779 · python/cpython

X Title: datetime.fromisoformat incorrectly accepts and parses strings without date-time separator · Issue #107779 · python/cpython

Description: Bug report Checklist I am confident this is a bug in CPython, not a bug in a third-party project I have searched the CPython issue tracker, and am confident this bug has not been reported before A clear and concise description of the bug...

Open Graph Description: Bug report Checklist I am confident this is a bug in CPython, not a bug in a third-party project I have searched the CPython issue tracker, and am confident this bug has not been reported before A ...

X Description: Bug report Checklist I am confident this is a bug in CPython, not a bug in a third-party project I have searched the CPython issue tracker, and am confident this bug has not been reported before A ...

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

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"datetime.fromisoformat incorrectly accepts and parses strings without date-time separator","articleBody":"\u003c!--\r\n  New to Python? The issue tracker isn't the right place to get help.\r\n  Consider instead:\r\n\r\n  - reading the Python tutorial: https://docs.python.org/3/tutorial/\r\n  - posting at https://discuss.python.org/c/users/7\r\n  - emailing https://mail.python.org/mailman/listinfo/python-list\r\n-->\r\n\r\n# Bug report\r\n\r\n## Checklist\r\n\r\n\u003c!-- Bugs in third-party projects (e.g. `requests`) do not belong in the CPython issue tracker -->\r\n\r\n- [x] I am confident this is a bug in CPython, not a bug in a third-party project\r\n- [x] I have searched the CPython issue tracker, and am confident this bug has not been reported before\r\n\r\n## A clear and concise description of the bug\r\n\r\nThis is a regression in Python 3.11 from 3.10\r\n\r\n  ```py\r\n  try:   \r\n    print(datetime.datetime.fromisoformat('20230808120000Z'))\r\n    assert 0, \"failed\"\r\n  except ValueError:\r\n    print(\"PASS\")\r\n  ```\r\n\r\nSince Python 3.11, `datetime.fromisoformat` invokes `_find_isoformat_datetime_separator` which tries to find where the separator is between the date and time, e.g. \"2023-08-08 12:00:00\" which is in position 10.\r\n\r\nFor strings without a date element separator (the dash) the function just outright returns 8. For the example above, that results in the string being parsed as `datetime(2023, 8, 8, 2, 0, 0)`. This is incorrect.\r\n\r\nSuggestion to fix:\r\n1. First alternative: the `_find_isoformat_datetime_separator` must always validate that the returned index must not be an ascii digit, that for all cases and branches inside the function.\r\n2. Second alternative: `datetime.fromisoformat` must check if `separator_location` points to an ascii digit or not, and if not complain about invalid date\r\n\r\n# Your environment\r\n\r\n\u003c!-- Include all relevant details about the environment you experienced the bug in -->\r\n\r\n- CPython versions tested on: 3.11.4\r\n- Operating system and architecture: Windows\r\n\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-107791\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/joaoe","@type":"Person","name":"joaoe"},"datePublished":"2023-08-08T13:27:23Z","url":"https://github.com/python/cpython/issues/107779"}

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:6b8cadd7-76ee-6495-df71-28acfeb83738
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-idE872:CC1A4:3BC3CE4:4C017D2:6B02021D
html-safe-nonce1622abc3fee93bc2928e6b1db2ad61bdf54c56407b6111670c3813ff9af6a695
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFODcyOkNDMUE0OjNCQzNDRTQ6NEMwMTdEMjo2QjAyMDIxRCIsInZpc2l0b3JfaWQiOiI3MDAzNTY2NjgxODkzMjQxMzczIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmacb35bde7339cc7b785a7780c6b3cf9b5a503239e09ef29faffe6c3dee09e07d6a
hovercard-subject-tagissue:1841320816
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/107779/issue_layout
twitter:imagehttps://opengraph.githubassets.com/a9ce28a5150a8dadeda61a40b7d6e2bccf1b4024445aecf803d9322a7001d180/python/cpython/issues/107779
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/a9ce28a5150a8dadeda61a40b7d6e2bccf1b4024445aecf803d9322a7001d180/python/cpython/issues/107779
og:image:altBug report Checklist I am confident this is a bug in CPython, not a bug in a third-party project I have searched the CPython issue tracker, and am confident this bug has not been reported before A ...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamejoaoe
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/107779#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F107779
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%2F107779
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/107779
Reloadhttps://github.com/python/cpython/issues/107779
Reloadhttps://github.com/python/cpython/issues/107779
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/107779
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/107779
datetime.fromisoformat incorrectly accepts and parses strings without date-time separatorhttps://github.com/python/cpython/issues/107779#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/joaoe
joaoehttps://github.com/joaoe
on Aug 8, 2023https://github.com/python/cpython/issues/107779#issue-1841320816
gh-107779: Check for the separator between date and time in datetime.datetime.fromisoformat #107791https://github.com/python/cpython/pull/107791
joaoehttps://github.com/joaoe
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Aug 8, 2023https://github.com/python/cpython/issues/107779#event-10035599852
AlexWaygoodhttps://github.com/AlexWaygood
Date and time issues 🕰️https://github.com/orgs/python/projects/21
on Aug 8, 2023https://github.com/python/cpython/issues/107779#event-14872093278
joaoehttps://github.com/joaoe
on Aug 8, 2023https://github.com/python/cpython/issues/107779#event-10039953320
pythongh-107779: in datetime.fromisoformat, check the separator betwe…https://github.com/joaoe/cpython/commit/ae18b325ffe5d77dc8ebde75ee765ae3dc1d50ea
pythongh-107779https://github.com/python/cpython/issues/107779
ae18b32https://github.com/joaoe/cpython/commit/ae18b325ffe5d77dc8ebde75ee765ae3dc1d50ea
https://github.com/pganssle
pgansslehttps://github.com/pganssle
on Aug 9, 2023https://github.com/python/cpython/issues/107779#issuecomment-1670595466
https://github.com/joaoe
joaoehttps://github.com/joaoe
on Aug 9, 2023https://github.com/python/cpython/issues/107779#issuecomment-1671014256
Wikipediahttps://en.wikipedia.org/wiki/ISO_8601#Combined_date_and_time_representations
[36]https://en.wikipedia.org/wiki/ISO_8601#cite_note-36
[37]https://en.wikipedia.org/wiki/ISO_8601#cite_note-37
https://github.com/pganssle
pgansslehttps://github.com/pganssle
on Aug 9, 2023https://github.com/python/cpython/issues/107779#issuecomment-1671308604
https://github.com/joaoe
joaoehttps://github.com/joaoe
on Aug 16, 2023https://github.com/python/cpython/issues/107779#issuecomment-1681372059
@pgansslehttps://github.com/pganssle
https://github.com/miccoli
miccolihttps://github.com/miccoli
on Aug 23, 2023https://github.com/python/cpython/issues/107779#issuecomment-1690298397
datetime.datetime.isoformathttps://docs.python.org/3/library/datetime.html#datetime.datetime.isoformat
https://github.com/joaoe
joaoehttps://github.com/joaoe
on Aug 25, 2023https://github.com/python/cpython/issues/107779#issuecomment-1693684196
@miccolihttps://github.com/miccoli
iritkatrielhttps://github.com/iritkatriel
stdlibStandard Library Python modules in the Lib/ directoryhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22stdlib%22
on Nov 26, 2023https://github.com/python/cpython/issues/107779#event-11064402100
https://github.com/cfbolz
cfbolzhttps://github.com/cfbolz
on Nov 28, 2023https://github.com/python/cpython/issues/107779#issuecomment-1830405231
https://foss.heptapod.net/pypy/pypy/-/issues/4039https://foss.heptapod.net/pypy/pypy/-/issues/4039
https://github.com/StanFromIreland
StanFromIrelandhttps://github.com/StanFromIreland
on Mar 15, 2025https://github.com/python/cpython/issues/107779#issuecomment-2726412649
https://github.com/miccoli
miccolihttps://github.com/miccoli
on Mar 15, 2025https://github.com/python/cpython/issues/107779#issuecomment-2727045898
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/107779
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/107779
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.