]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-100750: pass encoding kwarg in lib/platform.py (#100751)
authorThomas Grainger <tagrain@gmail.com>
Fri, 20 Jan 2023 22:25:38 +0000 (22:25 +0000)
committerGitHub <noreply@github.com>
Fri, 20 Jan 2023 22:25:38 +0000 (23:25 +0100)
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 b018046f5268d1ee585ee1f7e97f21d735346a1f..2dfaf76252db51257a2519255f55128a3434d16b 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))
@@ -824,6 +825,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