You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have searched the issues of this repo and believe that this is not a duplicate.
Pendulum version: 3.0.0
Issue
When parsing iso week dates, .parse() consistently raises a ParseError for the last day of each month:
>>> pendulum.parse('2024-W31-3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File ".pyenv/versions/chronicler/lib/python3.11/site-packages/pendulum/parser.py", line 30, in parse
return _parse(text, **options)
^^^^^^^^^^^^^^^^^^^^^^^
File ".pyenv/versions/chronicler/lib/python3.11/site-packages/pendulum/parser.py", line 43, in _parse
parsed = base_parse(text, **options)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File ".pyenv/versions/chronicler/lib/python3.11/site-packages/pendulum/parsing/__init__.py", line 78, in parse
return _normalize(_parse(text, **_options), **_options)
^^^^^^^^^^^^^^^^^^^^^^^^
File ".pyenv/versions/chronicler/lib/python3.11/site-packages/pendulum/parsing/__init__.py", line 125, in _parse
raise ParserError(f"Unable to parse string [{text}]")
pendulum.parsing.exceptions.ParserError: Unable to parse string [2024-W31-3]
This issue was not present in 3.0.0a.
This issue seems to only occur with the extension version of the parse_iso8601 function, and not with the native Python implementation:
>>> from pendulum._pendulum import parse_iso8601
>>> parse_iso8601('2024-W31-3')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ValueError: day is out of range for month
>>> from pendulum.parsing.iso8601 import parse_iso8601
>>> parse_iso8601('2024-W31-3')
datetime.date(2024, 7, 31)
The text was updated successfully, but these errors were encountered:
dav1dn
changed the title
pendulum.parse() consistently fails on the last day of each month in 3.0.0pendulum.parse() consistently fails on the last day of each month with iso week dates in 3.0.0
Jul 15, 2024
I am on the latest Pendulum version.
I have searched the issues of this repo and believe that this is not a duplicate.
Pendulum version: 3.0.0
Issue
When parsing iso week dates,
.parse()
consistently raises aParseError
for the last day of each month:This issue was not present in 3.0.0a.
This issue seems to only occur with the
extension
version of theparse_iso8601
function, and not with the native Python implementation:Reproduction table:
The text was updated successfully, but these errors were encountered: