STINNER Victor <vstin...@redhat.com> added the comment:
> Nice. I never liked the "parse the executable approach", but there wasn't > anything better available at the time. Aha. Well, it's not perfect but it works and was fast enough (since libc_ver() is never used in performance critical code) :-) I'm now curious and looked at the history of this feature. "man confstr" says: > _CS_GNU_LIBC_VERSION (GNU C library only; since glibc 2.3.2) glibc 2.3.2 has been released in March 2003, so it's fine, we should get this constant in most "modern" Linux (using glibc) in 2018 :-) man gnu_get_libc_version says: > These functions first appeared in glibc in version 2.1. glibc 2.1 has been released in Feb 1999. Using this function might provide even better compatibility but I'm not sure that it's worth it to use it. As I wrote, I prefer to not write a new function C, if os.confstr() can already be used in pure Python! Sadly, these functions (confstr(_CS_GNU_LIBC_VERSION) / gnu_get_libc_version()) are specific to glibc. Sorry, I'm not interested to support other libc, I mostly care about Fedora, sorry :-) ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue35389> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com