Skip to content

Dateparsing replacement in v3.4 is not 100% compatible #1580

Closed
@Yelinz

Description

@Yelinz

Datetime parsing breaks for certain formats on some python versions.

Python 3.10 fromisoformat accepted strings https://docs.python.org/3.10/library/datetime.html#datetime.datetime.fromisoformat

datetime.fromisoformat('2011-11-04')
datetime.fromisoformat('2011-11-04T00:05:23')
datetime.fromisoformat('2011-11-04 00:05:23.283')
datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')
datetime.fromisoformat('2011-11-04T00:05:23+04:00')   

Python 3.11 fromisoformat accepted strings https://docs.python.org/3.11/library/datetime.html#datetime.datetime.fromisoformat

datetime.fromisoformat('2011-11-04')
datetime.fromisoformat('20111104')
datetime.fromisoformat('2011-11-04T00:05:23')
datetime.fromisoformat('2011-11-04T00:05:23Z')
datetime.fromisoformat('20111104T000523')
datetime.fromisoformat('2011-W01-2T00:05:23.283')
datetime.fromisoformat('2011-11-04 00:05:23.283')
datetime.fromisoformat('2011-11-04 00:05:23.283+00:00')
datetime.fromisoformat('2011-11-04T00:05:23+04:00')   

We ran into the issue by using Z for UTC timezone in the datetime strings (2011-11-04T00:05:23Z) with python 3.10. Where as before 3.4 it still worked with the same input.

Bug introduced by 17d09c8

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions