Skip to content

ParserError custom __repr__ is not reached #991

@pganssle

Description

@pganssle

There is an indentation error in the definition for __str__/__repr__ in dateutil.parser.ParserError, which means that __repr__ is never even defined for the class:

>>> from dateutil.parser import ParserError
>>> ParserError("Hi")
dateutil.parser._parser.ParserError('Hi')

I think the definition of the repr is also a bit problematic, in that even if you fix the indentation issue, it would return ParserError(Hi) instead of ParserError('Hi') in the above situation. I will make a PR shortly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions