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

PEP 597: platform from_subprocess missing encoding kwarg #100750

Closed
graingert opened this issue Jan 4, 2023 · 1 comment
Closed

PEP 597: platform from_subprocess missing encoding kwarg #100750

graingert opened this issue Jan 4, 2023 · 1 comment
Labels
type-bug An unexpected behavior, bug, or error

Comments

@graingert
Copy link
Contributor

graingert commented Jan 4, 2023

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

@graingert graingert added the type-bug An unexpected behavior, bug, or error label Jan 4, 2023
graingert added a commit to graingert/cpython that referenced this issue Jan 4, 2023
ambv pushed a commit that referenced this issue Jan 20, 2023
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this issue Jan 20, 2023
)

(cherry picked from commit 6b3993c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
miss-islington added a commit that referenced this issue Jan 21, 2023
(cherry picked from commit 6b3993c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
@hauntsaninja
Copy link
Contributor

Thanks!

miss-islington pushed a commit to miss-islington/cpython that referenced this issue Feb 7, 2023
)

(cherry picked from commit 6b3993c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
jaraco added a commit to jaraco/skeleton that referenced this issue Feb 7, 2023
jaraco added a commit to jaraco/skeleton that referenced this issue Feb 7, 2023
clrpackages pushed a commit to clearlinux-pkgs/pypi-setuptools that referenced this issue Feb 16, 2023
…version 67.3.1

Anderson Bravalheri (34):
      Replace pkg_resources in version.py
      Extract normalization functions from editable_wheel and dist_info into own module
      Prefer setuptools._normalization instead of pkg_resources in develop.py
      Prefer setuptools._normalization and importlib_metadata instead of pkg_resources in dist.py
      Prefer setuptools._normalization instead of pkg_resources in egg_info.py
      Prefer packaging instead of pkg_resources in egg_info.py
      Prefer packaging instead of pkg_resources in dist.py for markers
      Implement alternative for pkg_resources.Distribution.egg_name in egg_info.py
      Prefer alternative from egg_info.py to pkg_resources.Distribution.egg_name
      Prefer packaging instead for pkg_resources for version in wheel.py
      Modify _reqs.py to prefer prefer packaging instead of pkg_resources
      Centralize usage of pkg_resources from dist.py to installer.py
      Delay imports of pkg_resources in install_scripts.py
      Replace/move _normalization.path with/to _path.samepath and _path.normpath
      Fix dist-info naming discrepancy in relation to bdist_wheel
      Revert to using normalized paths in develop to fix test errors
      Allow None to be passed to egg_basename
      Remove editable_wheel "catch all" exception
      Update note about SETUPTOOLS_ENABLE_FEATURES
      Use warning in editable since pip hides PEP 678 notes
      Clarify 'editable_wheel' and 'dist_info' are internal commands only
      Improve warning message
      Add test for debugging tips
      Add news fragment
      Add DeprecationWarning to `pkg_resources.declare_namespace`
      Add news fragment
      Add information on why namespace_packages are deprecated
      Add links explaining deprecations
      Add news items for 3792
      Small rewording for user-facing text/docs
      Bump version: 67.2.0 → 67.3.0
      Fix error when integrating with pip
      Add news fragment
      Bump version: 67.3.0 → 67.3.1

Jason R. Coombs (7):
      ALLOW_UNICODE no longer needed on Python 3. As a result, ELLIPSES is also now enabled by default.
      Enable default encoding warning where available. See PEP 597.
      Suppress EncodingWarning in pytest_black. Workaround for shopkeep/pytest-black#67.
      Exempt warning. Workaround for realpython/pytest-mypy#152
      Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750).
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Do not error on EncodingWarning. Instead emit them like usual. Ref #3810
clrpackages pushed a commit to clearlinux-pkgs/pypi-jaraco.functools that referenced this issue Feb 21, 2023
…2 to version 3.6.0

Jason R. Coombs (28):
      Update documentation of call_aside detailing the motivation and benefits of the construct.
      Adopt furo theme for docs.
      Indicate to use latest Python version (workaround for readthedocs/readthedocs.org/#9623). Requires also specifying the OS version (workaround for readthedocs/readthedocs.org#9635).
      GHA pretty env (#67)
      Pin mypy to '<0.990' due to realpython/pytest-mypy#141
      Remove the hyperlink for the Python versions badge. The PyPI badge is a better anchor for the hyperlink.
      Apply explicit_package_bases for mypy and unpin the version. Ref python/mypy#14057.
      Add Python 3.12 to matrix. Only test 3.8-3.10 on Linux.
      Disable flake8 on Python 3.12. Workaround for tholo/pytest-flake8#87.
      Honor ResourceWarnings. Fixes jaraco/skeleton#73.
      tox 4 requires a boolean value, so use '1' to FORCE_COLOR. Fixes jaraco/skeleton#74.
      Remove unnecessary shebang and encoding header in docs conf.
      Prevent Python 3.12 from blocking checks.
      Build docs in CI, including sphinx-lint.
      Restore doctests by utilizing importlib. Ref pytest-dev/pytest#3396.
      Put tidelift docs dependency in its own section to limit merge conflicts.
      Update badge for 2023
      ALLOW_UNICODE no longer needed on Python 3. As a result, ELLIPSES is also now enabled by default.
      Enable default encoding warning where available. See PEP 597.
      Suppress EncodingWarning in pytest_black. Workaround for shopkeep/pytest-black#67.
      Exempt warning. Workaround for realpython/pytest-mypy#152
      Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750).
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Revert "exclude build env from cov reporting (jaraco/skeleton#60)"
      Disable couldnt-parse warnings. Prescribed workaround for nedbat/coveragepy#1392. Fixes python/importlib_resources#279 and fixes jaraco/skeleton#56.
      Renamed 'call_aside' to 'invoke'. Fixes #21.
      Replace 'called_with' with 'assert_called_with'.
      🚡 Toil the docs.

Zach Burnett (1):
      rename `.readthedocs.yml` to `.readthedocs.yaml` (RTD docs indicate that `.readthedocs.yml` will be deprecated) (#68)
clrpackages pushed a commit to clearlinux-pkgs/pypi-importlib_resources that referenced this issue Feb 21, 2023
….10.2 to version 5.12.0

Gregory P. Smith (1):
      gh-82874: Convert remaining importlib format uses to f-str. (#98005)

Jason R. Coombs (27):
       Fade to black.
      Prefer docstrings to comments where appropriate.
      Update badge for 2023
      ALLOW_UNICODE no longer needed on Python 3. As a result, ELLIPSES is also now enabled by default.
      Enable default encoding warning where available. See PEP 597.
      Suppress EncodingWarning in pytest_black. Workaround for shopkeep/pytest-black#67.
      Exempt warning. Workaround for realpython/pytest-mypy#152
      In MultiplexedPath.iterdir, honor multiple subdirectories of the same name.
      Prefer tee and only.
      Update changelog.
      Add section on Namespace Packages. Fixes #262.
      Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750).
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Revert "exclude build env from cov reporting (jaraco/skeleton#60)"
      Remove 'absolute' call, unneeded.
      Extract fixture for zip_on_path.
      Prefer suppress to except/pass.
      Disable couldnt-parse warnings. Prescribed workaround for nedbat/coveragepy#1392. Fixes python/importlib_resources#279 and fixes jaraco/skeleton#56.
      Update _path.build/create from jaraco.path 3.4.1. Fixes EncodingWarnings.
      Fix EncodingWarnings
      Update changelog.
      Pass 'encoding' to target.open in test_open_text_FileNotFoundError. Fixes #280.
      Update changelog.
      Add tests capturing expectation of custom loaders. Ref #268.
      Disable native reader even if it supplies files, because it might not have features/fixes present in this library. Fixes #257.
      Give the local zip/namespace/file readers precedence over the native reader.
      Update changelog.

Joost Ellerbroek (1):
      Add test for MultiplexedPath.joinpath with common subdirs
clrpackages pushed a commit to clearlinux-pkgs/pypi-zipp that referenced this issue Feb 28, 2023
…n 3.15.0

Jason R. Coombs (15):
      Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750).
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Revert "exclude build env from cov reporting (jaraco/skeleton#60)"
      Disable couldnt-parse warnings. Prescribed workaround for nedbat/coveragepy#1392. Fixes python/importlib_resources#279 and fixes jaraco/skeleton#56.
      Consume the _implied_dirs result, ensuring the algorithmic effect is exercised. Ref python/cpython#102209.
      Add doctests for _implied_dirs illustrating the behavior.
      Add test for getinfo on a missing. Restores 100% coverage.
      Fix EncodingWarning in doctest.
      Fix EncodingWarning in test_pickle.
      Fix coverage in conftest
      Use consume from more_itertools.
      Measure the complexity directly using the big-O library. Fixes python/cpython#102209.
      Allow sub-linear complexity (as observed on PyPy).
      Move complexity tests to their own module.
      Update changelog.
clrpackages pushed a commit to clearlinux-pkgs/pypi-importlib_metadata that referenced this issue Mar 22, 2023
…0.0 to version 6.1.0

Filipe Laíns (3):
      Sync PackageMetadata with email.message.Message
      Fix formatting in test_api
      Add missing modules to packages_distributions

Jason R. Coombs (16):
      Update badge for 2023
      ALLOW_UNICODE no longer needed on Python 3. As a result, ELLIPSES is also now enabled by default.
      Enable default encoding warning where available. See PEP 597.
      Suppress EncodingWarning in pytest_black. Workaround for shopkeep/pytest-black#67.
      Exempt warning. Workaround for realpython/pytest-mypy#152
      Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750).
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Revert "exclude build env from cov reporting (jaraco/skeleton#60)"
      Disable couldnt-parse warnings. Prescribed workaround for nedbat/coveragepy#1392. Fixes python/importlib_resources#279 and fixes jaraco/skeleton#56.
      Add comment to link rationale for existence.
      👹 Feed the hobgoblins (delint).
      Update changelog.
      Extend the workaround to satisfy docstring of typing._overload_dummy.
      Remove long-line comment.
      Extract variable for optional names.
      Restore logic for parts.
clrpackages pushed a commit to clearlinux-pkgs/pypi-jaraco.collections that referenced this issue Mar 25, 2023
…8.0 to version 3.9.0

Jason R. Coombs (24):
      Pin mypy to '<0.990' due to realpython/pytest-mypy#141
      Remove the hyperlink for the Python versions badge. The PyPI badge is a better anchor for the hyperlink.
      Apply explicit_package_bases for mypy and unpin the version. Ref python/mypy#14057.
      Add Python 3.12 to matrix. Only test 3.8-3.10 on Linux.
      Disable flake8 on Python 3.12. Workaround for tholo/pytest-flake8#87.
      Honor ResourceWarnings. Fixes jaraco/skeleton#73.
      tox 4 requires a boolean value, so use '1' to FORCE_COLOR. Fixes jaraco/skeleton#74.
      Remove unnecessary shebang and encoding header in docs conf.
      Prevent Python 3.12 from blocking checks.
      Build docs in CI, including sphinx-lint.
      Restore doctests by utilizing importlib. Ref pytest-dev/pytest#3396.
      Put tidelift docs dependency in its own section to limit merge conflicts.
      Update badge for 2023
      ALLOW_UNICODE no longer needed on Python 3. As a result, ELLIPSES is also now enabled by default.
      Enable default encoding warning where available. See PEP 597.
      Suppress EncodingWarning in pytest_black. Workaround for shopkeep/pytest-black#67.
      Exempt warning. Workaround for realpython/pytest-mypy#152
      Remove superfluous str calls.
      Add #upstream markers for filtered warnings. Add filter for platform module (ref python/cpython#100750).
      Remove reference to EncodingWarning as it doesn't exist on some Pythons.
      Revert "exclude build env from cov reporting (jaraco/skeleton#60)"
      Disable couldnt-parse warnings. Prescribed workaround for nedbat/coveragepy#1392. Fixes python/importlib_resources#279 and fixes jaraco/skeleton#56.
      🚡 Toil the docs.
      Use set intersection len for DictFilter. Fixes #12.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants