Skip to content

Parser raises ValueError instead of ParseError for empty strings #849

@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 [].

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions