[Python-checkins] bpo-35389: platform.platform() calls libc_ver() without executable (GH-14418)

Victor Stinner webhook-mailer at python.org
Thu Jun 27 03:04:39 EDT 2019

commit: a719c8f4bd3cc5b1d98700c15c4a818f4d5617a4
branch: master
author: Victor Stinner <vstinner at redhat.com>
committer: GitHub <noreply at github.com>
date: 2019-06-27T09:04:28+02:00

bpo-35389: platform.platform() calls libc_ver() without executable (GH-14418)

When libc_ver() is called with an executable, the
os.confstr('CS_GNU_LIBC_VERSION') fast-path cannot be taken. Modify
platform.platform() to call libc_ver() without executable, instead of
calling libc_ver(sys.executable), since sys.executable is already the
default value.

M Lib/platform.py

diff --git a/Lib/platform.py b/Lib/platform.py
index 6fbb7b08c598..ed41edc98fe0 100755
--- a/Lib/platform.py
+++ b/Lib/platform.py
@@ -1202,7 +1202,7 @@ def platform(aliased=0, terse=0):
     elif system in ('Linux',):
         # check for libc vs. glibc
-        libcname, libcversion = libc_ver(sys.executable)
+        libcname, libcversion = libc_ver()
         platform = _platform(system, release, machine, processor,

More information about the Python-checkins mailing list