What version of glibc is Python using?

Christian Gollwitzer auriocus at gmx.de
Sat Oct 12 04:34:54 EDT 2013


Am 12.10.13 09:53, schrieb Christian Gollwitzer:
> Am 12.10.13 09:20, schrieb Ned Deily:
>> In article <l3as90$5bk$1 at dont-email.me>, John Nagle <nagle at animats.com>
>> wrote:
>> [...]
>>> Why is the info from "plaform.libc_ver()" so bogus?
>>
>> The code is here:
>>
>> http://hg.python.org/cpython/file/2.7/Lib/platform.py#l141
>>
>> Perhaps you could open an issue on the Python bug tracker.
>
> That function is really bogus. It states itself, that it has "intimate
> knowledge of how different libc versions add symbols to the executable
> and thus is probably only useable for executables compiled using gcc"
> which is just another way of saying "it'll become outdated and broken
> soon". It's not even done by reading the symbol table, it opens the
> binary and matches a RE *shocked* I would have expected such hacks in a
> shell script.

And it also explains why this fails:

	egrep -o -a GLIBC_[0-9.]* /usr/bin/python

reports multiple matches, with the first being the lowest compatibility 
version.

	Christian



More information about the Python-list mailing list