Skip to content

fix: raise ParserError for empty string in parse()#965

Merged
ashb merged 1 commit into
python-pendulum:masterfrom
SAY-5:fix-parse-empty-string
May 14, 2026
Merged

fix: raise ParserError for empty string in parse()#965
ashb merged 1 commit into
python-pendulum:masterfrom
SAY-5:fix-parse-empty-string

Conversation

@SAY-5
Copy link
Copy Markdown
Contributor

@SAY-5 SAY-5 commented May 13, 2026

Pull Request Check List

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

pendulum.parse("") raised ValueError: year 0 is out of range instead of ParserError; the common-format parser now rejects a match that captured neither a date nor a time component. Closes #849.

@codspeed-hq
Copy link
Copy Markdown

codspeed-hq Bot commented May 14, 2026

Merging this PR will not alter performance

✅ 1 untouched benchmark


Comparing SAY-5:fix-parse-empty-string (4d6aa6a) with master (0a88aec)

Open in CodSpeed

@ashb ashb merged commit b99bd14 into python-pendulum:master May 14, 2026
26 of 34 checks passed
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.

Parser raises ValueError instead of ParseError for empty strings

2 participants