[Python-checkins] gh-100750: pass encoding kwarg in lib/platform.py (GH-100751)
miss-islington
webhook-mailer at python.org
Sat Jan 21 00:08:03 EST 2023
https://github.com/python/cpython/commit/c6cfde6fb135d45a61670300b91e68805e61042a
commit: c6cfde6fb135d45a61670300b91e68805e61042a
branch: 3.11
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: miss-islington <31488909+miss-islington at users.noreply.github.com>
date: 2023-01-20T21:07:56-08:00
summary:
gh-100750: pass encoding kwarg in lib/platform.py (GH-100751)
(cherry picked from commit 6b3993c556eb3bb36d1754a17643cddd3f6ade92)
Co-authored-by: Thomas Grainger <tagrain at gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja at users.noreply.github.com>
files:
A Misc/NEWS.d/next/Library/2023-01-04-14-42-59.gh-issue-100750.iFJs5Y.rst
M Lib/platform.py
diff --git a/Lib/platform.py b/Lib/platform.py
index 9e9f3af3ce4b..9b9d88bf5844 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -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 @@ def from_subprocess():
['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
index 000000000000..be351532822c
--- /dev/null
+++ b/Misc/NEWS.d/next/Library/2023-01-04-14-42-59.gh-issue-100750.iFJs5Y.rst
@@ -0,0 +1 @@
+pass encoding kwarg to subprocess in platform
More information about the Python-checkins
mailing list