Skip to content

PEP 597: platform from_subprocess missing encoding kwarg #100750

Closed

Description

@graingert

Bug report

python3.11 -W error -X warn_default_encoding -c "import platform; print(platform.uname().processor)"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib/python3.11/functools.py", line 1001, in __get__
    val = self.func(instance)
          ^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/platform.py", line 792, in processor
    return _unknown_as_blank(_Processor.get())
                             ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/platform.py", line 738, in get
    return func() or ''
           ^^^^^^
  File "/usr/lib/python3.11/platform.py", line 761, in from_subprocess
    return subprocess.check_output(
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 466, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 548, in run
    with Popen(*popenargs, **kwargs) as process:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 908, in __init__
    self.encoding = encoding = _text_encoding()
                               ^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 372, in _text_encoding
    warnings.warn("'encoding' argument not specified.",
EncodingWarning: 'encoding' argument not specified.

Your environment

  • CPython versions tested on:
  • Operating system and architecture:

Linked PRs

Activity

  1. added a commit that references this issue on Jan 4, 2023
  2. added a commit that references this issue on Jan 20, 2023
  3. added 2 commits that reference this issue on Jan 20, 2023
  4. hauntsaninja commented on Jan 21, 2023

    @hauntsaninja
    Contributor

    Thanks!

  5. added a commit that references this issue on Feb 7, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    type-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions