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

Specify encoding in fdopen. #196

Merged
merged 3 commits into from
Jul 4, 2023

Conversation

jaraco
Copy link
Contributor

@jaraco jaraco commented Jun 27, 2023

Fixes #195

@jaraco
Copy link
Contributor Author

jaraco commented Jun 27, 2023

This change doesn't fix but reveals many more EncodingWarnings in tests (but no more in the library).

testing/test_basics.py::test_subprocess_interaction[sys.executable]
testing/test_basics.py::test_subprocess_interaction[pypy3]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_basics.py:72: EncodingWarning: 'encoding' argument not specified.
    popen = subprocess.Popen(

testing/test_basics.py::test_io_message[thread-sys.executable]
testing/test_basics.py::test_io_message[thread-pypy3]
testing/test_basics.py::test_popen_io[thread-sys.executable]
testing/test_basics.py::test_popen_io[thread-pypy3]
testing/test_basics.py::test_rinfo_source[sys.executable]
testing/test_basics.py::test_rinfo_source[pypy3]
testing/test_basics.py::test_geterrortext[sys.executable]
testing/test_basics.py::test_geterrortext[pypy3]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_basics.py:160: EncodingWarning: 'encoding' argument not specified
    check_path.write_text(script)

testing/test_basics.py::test_io_message[thread-sys.executable]
testing/test_basics.py::test_io_message[thread-pypy3]
testing/test_basics.py::test_popen_io[thread-sys.executable]
testing/test_basics.py::test_popen_io[thread-pypy3]
testing/test_basics.py::test_rinfo_source[sys.executable]
testing/test_basics.py::test_rinfo_source[pypy3]
testing/test_basics.py::test_geterrortext[sys.executable]
testing/test_basics.py::test_geterrortext[pypy3]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_basics.py:161: EncodingWarning: 'encoding' argument not specified.
    return subprocess.run(

testing/test_gateway.py::TestBasicGateway::test_remote_exec_module[thread-popen]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module[thread-socket]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module[thread-proxy]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_gateway.py:97: EncodingWarning: 'encoding' argument not specified
    p.write_text("channel.send(1)")

testing/test_gateway.py::TestBasicGateway::test_remote_exec_module[thread-popen]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module[thread-socket]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module[thread-proxy]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_gateway.py:103: EncodingWarning: 'encoding' argument not specified
    p.write_text("channel.send(2)")

testing/test_gateway.py::TestBasicGateway::test_remote_exec_module_is_removed[thread-popen]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module_is_removed[thread-socket]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module_is_removed[thread-proxy]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_gateway.py:110: EncodingWarning: 'encoding' argument not specified
    remotetest.write_text(

testing/test_gateway.py::TestBasicGateway::test_remote_exec_module_with_traceback[thread-popen]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module_with_traceback[thread-socket]
testing/test_gateway.py::TestBasicGateway::test_remote_exec_module_with_traceback[thread-proxy]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_gateway.py:141: EncodingWarning: 'encoding' argument not specified
    remotetestpy.write_text(

testing/test_threadpool.py::test_execmodel[thread]
  /Users/jaraco/code/pytest-dev/execnet/testing/test_threadpool.py:11: EncodingWarning: 'encoding' argument not specified
    p.write_text("content")

testing/test_gateway.py::TestTracing::test_popen_filetracing
  /Users/jaraco/code/pytest-dev/execnet/testing/test_gateway.py:456: EncodingWarning: 'encoding' argument not specified
    with workerfile.open() as f:

testing/test_rsync.py::TestRSync::test_dirsync
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:89: EncodingWarning: 'encoding' argument not specified
    subdir.joinpath("file1").write_text(s)

testing/test_rsync.py::TestRSync::test_dirsync
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:96: EncodingWarning: 'encoding' argument not specified
    assert dest.joinpath("subdir", "file1").read_text() == s

testing/test_rsync.py::TestRSync::test_dirsync
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:99: EncodingWarning: 'encoding' argument not specified
    assert dest2.joinpath("subdir", "file1").read_text() == s

testing/test_rsync.py::TestRSync::test_callback
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:267: EncodingWarning: 'encoding' argument not specified
    source.joinpath("existent").write_text("a" * 100)

testing/test_rsync.py::TestRSync::test_callback
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:268: EncodingWarning: 'encoding' argument not specified
    source.joinpath("existant2").write_text("a" * 10)

testing/test_rsync.py::TestRSync::test_file_disappearing
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:284: EncodingWarning: 'encoding' argument not specified
    source.joinpath("ex").write_text("a" * 100)

testing/test_rsync.py::TestRSync::test_file_disappearing
  /Users/jaraco/code/pytest-dev/execnet/testing/test_rsync.py:285: EncodingWarning: 'encoding' argument not specified
    source.joinpath("ex2").write_text("a" * 100)

testing/test_serializer.py: 15 warnings
  /Users/jaraco/code/pytest-dev/execnet/testing/test_serializer.py:21: EncodingWarning: 'encoding' argument not specified
    script_file.write_text(

testing/test_serializer.py: 15 warnings
  /Users/jaraco/code/pytest-dev/execnet/testing/test_serializer.py:37: EncodingWarning: 'encoding' argument not specified
    script_file.write_text(

testing/test_termination.py::test_termination_on_remote_channel_receive
  /Users/jaraco/code/pytest-dev/execnet/testing/test_termination.py:69: EncodingWarning: 'encoding' argument not specified.
    output = subprocess.run(command, capture_output=True, text=True)

@nicoddemus
Copy link
Member

Thanks @jaraco!

We can live with the warnings in the tests for now. 👍

@nicoddemus nicoddemus merged commit 870891d into pytest-dev:master Jul 4, 2023
12 checks passed
@jaraco jaraco deleted the bugfix/195-encodingwarning branch July 4, 2023 12:10
@Zac-HD
Copy link
Member

Zac-HD commented Jul 4, 2023

🎉 I was just trying to enable PYTHONWARNDEFAULTENCODING=1 after HypothesisWorks/hypothesis#3619, and discovered that this last blocker had been fixed mere hours before 😍

...do we have release plans though? It's been two years, but v1.9.0...master is a lot of bugfixes to keep off PyPI. I'm just going to install from the commit, but it'd be nice to share more widely.

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

Successfully merging this pull request may close these issues.

EncodingWarning when PYTHONWARNDEFAULTENCODING=1
3 participants