Skip to content

Error messages about stdlib modules not consistent #5351

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

Closed
ysangkok opened this issue Jul 13, 2018 · 1 comment
Closed

Error messages about stdlib modules not consistent #5351

ysangkok opened this issue Jul 13, 2018 · 1 comment

Comments

@ysangkok
Copy link
Contributor

ysangkok commented Jul 13, 2018

Using mypy from master, reporting a usability bug.

Mypy seems to recognize standard library imports:

/usr/local/lib/python3.6/dist-packages/dns/entropy.py:23: error: No library stub file for standard library module 'dummy_threading'

But when I got an error message about "encodings.idna", I didn't think it was a stdlib module since Mypy used a different wording:

/usr/local/lib/python3.6/dist-packages/dns/name.py:23: error: Cannot find module named 'encodings.idna'

But encodings.idna is in Python! See https://github.com/python/cpython/blob/master/Lib/encodings/idna.py

Thank you for your patience, I hope the bug report is good, please let me know if you need further information.

@Michael0x2a
Copy link
Collaborator

Hmm, it looks like the encodings module is missing from the list of standard library modules located here -- probably an oversight?

https://github.com/python/mypy/blob/master/mypy/moduleinfo.py

In any case, do you want to try submitting a PR for this? I think the only change you'll need to make is adding the string "encodings" to the appropriate list.

(Or alternatively, if you're feeling up to it, you could try contributing stubs for the encoding module to typeshed. That's a much bigger task though.)

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

No branches or pull requests

2 participants