What version of glibc is Python using?

Christian Gollwitzer auriocus at gmx.de
Sat Oct 12 03:53:18 EDT 2013


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.

glibc has a function for this:

	gnu_get_libc_version ()

which should be used.


	Christian



More information about the Python-list mailing list