Skip to content

Error messages about stdlib modules not consistent #5351

Closed

Description

@ysangkok

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.

Activity

  1. Michael0x2a commented on Jul 18, 2018

    @Michael0x2a
    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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions