]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100750: pass encoding kwarg in lib/platform.py (GH-100751)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Sat, 21 Jan 2023 05:07:56 +0000 (21:07 -0800)
committerGitHub <noreply@github.com>
Sat, 21 Jan 2023 05:07:56 +0000 (21:07 -0800)
(cherry picked from commit 6b3993c556eb3bb36d1754a17643cddd3f6ade92)

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>
Lib/platform.py
Misc/NEWS.d/next/Library/2023-01-04-14-42-59.gh-issue-100750.iFJs5Y.rst [new file with mode: 0644]

index 9e9f3af3ce4b27b65cb259138a3d0bbe405f4ff3..9b9d88bf584433a232a9d81e47e4c799c805ebb8 100755 (executable)
@@ -285,6 +285,7 @@ def _syscmd_ver(system='', release='', version='',
                                            stdin=subprocess.DEVNULL,
                                            stderr=subprocess.DEVNULL,
                                            text=True,
+                                           encoding="locale",
                                            shell=True)
         except (OSError, subprocess.CalledProcessError) as why:
             #print('Command %s failed: %s' % (cmd, why))
@@ -762,6 +763,7 @@ class _Processor:
                 ['uname', '-p'],
                 stderr=subprocess.DEVNULL,
                 text=True,
+                encoding="utf8",
             ).strip()
         except (OSError, subprocess.CalledProcessError):
             pass
diff --git a/Misc/NEWS.d/next/Library/2023-01-04-14-42-59.gh-issue-100750.iFJs5Y.rst b/Misc/NEWS.d/next/Library/2023-01-04-14-42-59.gh-issue-100750.iFJs5Y.rst
new file mode 100644 (file)
index 0000000..be35153
--- /dev/null
@@ -0,0 +1 @@
+pass encoding kwarg to subprocess in platform