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

Missing ParserError in dateutils.parser #4299

Closed
lulivi opened this issue Jul 1, 2020 · 7 comments · Fixed by #4616
Closed

Missing ParserError in dateutils.parser #4299

lulivi opened this issue Jul 1, 2020 · 7 comments · Fixed by #4616
Labels
stubs: incomplete Annotations or sub-modules missing from an existing package or module

Comments

@lulivi
Copy link

lulivi commented Jul 1, 2020

It seems the ParserError is missing in dateutil/parser stubs file.

Error:

module.py:12: error: Module 'dateutil.parser' has no attribute 'ParserError'
Found 1 error in 1 file (checked 1 source file)

Dateutil dir:

>>> import dateutil.parser
>>> dir(dateutil.parser)
['DEFAULTPARSER', 'DEFAULTTZPARSER', 'ParserError', 'UnknownTimezoneWarning', '__all__', '__builtins__', '__cached__', '__deprecate_private_class', '__deprecated_private_func', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', '_parser', '_parsetz', '_resultbase', '_timelex', '_tzparser', 'isoparse', 'isoparser', 'parse', 'parser', 'parserinfo']

Packages versions

mypy==0.770
mypy-extensions==0.4.3
> python --version
Python 3.8.3

Edit: add Python version

@srittau srittau added size-small stubs: incomplete Annotations or sub-modules missing from an existing package or module labels Jul 1, 2020
@srittau
Copy link
Collaborator

srittau commented Jul 1, 2020

Indeed, PR welcome!

@lulivi
Copy link
Author

lulivi commented Jul 4, 2020

I'll try in a week or two!

@fsabr
Copy link
Contributor

fsabr commented Oct 5, 2020

Is this issue still open? Can I take it up if it is? I'm new here.

@JelleZijlstra
Copy link
Member

Anyone reading this feel free to submit a PR.

@fsabr
Copy link
Contributor

fsabr commented Oct 5, 2020

I have a doubt. Is this as simple as adding a line in the respective file?
I found that ParseError was added in dateutil 2.8.1 according to this. So wouldn't it make a mistake if the user were using an older version of dateutil?

@JelleZijlstra
Copy link
Member

Yes, it's probably just adding a single line to the stub file. typeshed generally tries to reflect the latest version of each library.

@fsabr
Copy link
Contributor

fsabr commented Oct 6, 2020

I've done it. Could someone review it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stubs: incomplete Annotations or sub-modules missing from an existing package or module
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants