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

EncodingWarning when running under PyPy #17057

Open
jaraco opened this issue Mar 22, 2024 · 1 comment
Open

EncodingWarning when running under PyPy #17057

jaraco opened this issue Mar 22, 2024 · 1 comment
Labels
bug mypy got something wrong

Comments

@jaraco
Copy link
Member

jaraco commented Mar 22, 2024

Bug Report

In this comment, I describe the warnings that I see when enabling mypy checks in PyPy.

To Reproduce

Grab jaraco/keyring@e9285df and run tox -e pypy (or tox -e pypy3 if pypy is aliased to Python 2). Note the tests run with PYTHONWARNDEFAULTENCODING=true.

Expected Behavior

There should be no warnings.

Actual Behavior

Warnings are emitted, three directly implicating mypy code and one implicated in configparser for mypy checks. I just ran the tests again and got even more warnings.

conftest.py::mypy
  /opt/homebrew/Cellar/pypy3.10/7.3.15/libexec/lib/pypy3.10/configparser.py:694: EncodingWarning: 'encoding' argument not specified.
    encoding = io.text_encoding(encoding)

conftest.py::mypy
  /Users/jaraco/code/jaraco/keyring/.tox/pypy/lib/pypy3.10/site-packages/mypy/modulefinder.py:851: EncodingWarning: 'encoding' argument not specified.
    with open(versions_path) as f:

conftest.py::mypy
  /Users/jaraco/code/jaraco/keyring/.tox/pypy/lib/pypy3.10/site-packages/mypy/metastore.py:108: EncodingWarning: 'encoding' argument not specified.
    with open(tmp_filename, "w") as f:

conftest.py::mypy
  /Users/jaraco/code/jaraco/keyring/.tox/pypy/lib/pypy3.10/site-packages/mypy/build.py:1187: EncodingWarning: 'encoding' argument not specified.
    with open(gitignore, "x") as f:

conftest.py::mypy
  /Users/jaraco/code/jaraco/keyring/.tox/pypy/lib/pypy3.10/site-packages/mypy/build.py:1201: EncodingWarning: 'encoding' argument not specified.
    with open(cachedir_tag, "x") as f:

conftest.py::mypy
  /Users/jaraco/code/jaraco/keyring/.tox/pypy/lib/pypy3.10/site-packages/mypy/build.py:3526: EncodingWarning: 'encoding' argument not specified.
    with open(fnam, "w") as f:

Your Environment

@jaraco jaraco added the bug mypy got something wrong label Mar 22, 2024
@jaraco
Copy link
Member Author

jaraco commented Mar 22, 2024

I don't yet understand why these warnings are not emitted under CPython. Perhaps there is a filter configured that's failing to match in PyPy.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug mypy got something wrong
Projects
None yet
Development

No branches or pull requests

1 participant