Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ParserError custom __repr__ is not reached #991

Closed
pganssle opened this issue Jan 2, 2020 · 0 comments · Fixed by #993
Closed

ParserError custom __repr__ is not reached #991

pganssle opened this issue Jan 2, 2020 · 0 comments · Fixed by #993
Milestone

Comments

@pganssle
Copy link
Member

pganssle commented Jan 2, 2020

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.

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

Successfully merging a pull request may close this issue.

1 participant