Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

datetime.fromisoformat() parses offset minutes outside 00-59 range #126883

Closed
Labels
3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesextension-modulesC modules in the Modules dirstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
@ariebovenberg

Description

@ariebovenberg

Bug report

Bug description:

>>>datetime.fromisoformat('2020-01-01T00:00+00:90')datetime.datetime(2020,1,1,0,0,tzinfo=datetime.timezone(datetime.timedelta(seconds=5400)))

expected result:ValueError (90 minutes is out of range 00-59)

I wasn't able to find a definitive paragraph of the ISO8601 to quote (it's not an open standard), but it appears datetime libraries in other languages (Temporal, NodaTime) do enforce this. Also, RFC3339 does explicitly forbid offset minutes outside the 00-59 range.

What are your thoughts?

CPython versions tested on:

3.13

Operating systems tested on:

macOS

Linked PRs

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.12only security fixes3.13bugs and security fixes3.14bugs and security fixesextension-modulesC modules in the Modules dirstdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions


      [8]ページ先頭

      ©2009-2025 Movatter.jp