]> granicus.if.org Git - python/commitdiff
bpo-35389: platform.platform() calls libc_ver() without executable (GH-14418)
authorVictor Stinner <vstinner@redhat.com>
Thu, 27 Jun 2019 07:04:28 +0000 (09:04 +0200)
committerGitHub <noreply@github.com>
Thu, 27 Jun 2019 07:04:28 +0000 (09:04 +0200)
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.

Lib/platform.py

index 6fbb7b08c598e3d1782479ab492e4d8c964604ef..ed41edc98fe0870b85988c61b3dca75ebc34664e 100755 (executable)
@@ -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,
                              'with',
                              libcname+libcversion)