Skip to content

Reject an ISO week date outside week 1-53 or weekday 1-7 - #1018

Open
SashaMIT wants to merge 1 commit into
python-pendulum:masterfrom
SashaMIT:codered-iso-week
Open

SashaMIT wants to merge 1 commit into
python-pendulum:masterfrom
SashaMIT:codered-iso-week

Conversation

@SashaMIT

Copy link
Copy Markdown

Summary

  • parse_iso8601("2015-W00") returned 22 December 2014. parse_iso8601("2015-W01-0") returned 28 December 2014. The week and weekday checks only had an upper bound.
  • Those strings now raise. 2012-W05 is still 30 January 2012, and 2009-W53-7 is still 3 January 2010.

Test plan

  • pytest tests/parsing/test_parse_iso8601.py failed before the fix (2015-W00 did not raise) and passes after it (55 tests), with PENDULUM_EXTENSIONS=0
  • The Rust parser returned 2014-12-22 and 2014-12-28 before the fix, and raises after it. 2012-W05 is still 2012-01-30

Made with Cursor

2015-W00 parsed as 22 December 2014. 2015-W01-0 parsed as 28 December 2014. 2012-W05 is still 30 January 2012.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant