Skip to content

Parser raises ValueError instead of ParseError for empty strings #849

Open
@MSDehghan

Description

@MSDehghan
  • I am on the latest Pendulum version.

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

  • OS version and name: Ubuntu 24.04

  • Pendulum version: 3.0.0

Issue

Current Behavior:
pendulum.parse("") raises ValueError: year 0 is out of range. Apparently it should raise ParseError just like the case of passing a single-space string(pendulum.parse(" ")) which raises ParserError: Unable to parse string [ ] .

Expected Behavior:
It should raise ParserError: Unable to parse string [].

Activity

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

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