Skip to content

Pendulum 3.0.0 unable to parse specific date / weeknumber #839

Open
@jakobdo

Description

@jakobdo
  • I am on the latest Pendulum version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • Windows 11 - 23H2

  • 3.0.0

Hello,
when trying to parse the following date / weeknumber: "2024W401" I noticed updating from 2.1.2 to 3.0.0 my code started to fail.

Pendulum 2.1.2
pendulum.parse("2024W401", tz="CET")
DateTime(2024, 9, 30, 0, 0, 0, tzinfo=Timezone('CET'))

Pendulum 3.0.0
pendulum.parse("2024W401", tz="CET")
pendulum.parsing.exceptions.ParserError: Unable to parse string [2024W401]

The following "strings" works ok:
pendulum.parse("2024W400", tz="CET")
DateTime(2024, 9, 29, 0, 0, 0, tzinfo=Timezone('CET'))
pendulum.parse("2024W402", tz="CET")
DateTime(2024, 10, 1, 0, 0, 0, tzinfo=Timezone('CET'))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions