Skip to content

Reject bare hours in the pure Python parser - #1101

Open
noooooooookro wants to merge 1 commit into
python-pendulum:masterfrom
noooooooookro:reject-bare-hour-in-python-parser
Open

noooooooookro wants to merge 1 commit into
python-pendulum:masterfrom
noooooooookro:reject-bare-hour-in-python-parser

Conversation

@noooooooookro

Copy link
Copy Markdown

pendulum.parse("13") returned 1 pm with extensions disabled and raised ParserError with the Rust parser. The Python parser now requires a T prefix for a standalone hour. Both T13 and 13:00 still work.

With strict=False, both backends pass "13" to dateutil, which interprets it as the 13th day of the month.

The full test suite passed on Windows with and without extensions.

Fixes #394.

Pull Request Check List

  • Added tests for changed code.
  • Updated documentation for changed code.

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.

"parse()" for ambiguous number does not raise exception with Pendlum pure Python implemention

1 participant