Skip to content

PEP 597: platform from_subprocess missing encoding kwarg #100750

@graingert

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

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

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy