[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2019-06-27 Thread STINNER Victor
STINNER Victor added the comment: New changeset a719c8f4bd3cc5b1d98700c15c4a818f4d5617a4 by Victor Stinner in branch 'master': bpo-35389: platform.platform() calls libc_ver() without executable (GH-14418) https://github.com/python/cpython/commit/a719c8f4bd3cc5b1d98700c15c4a818f4d5617a4

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2019-06-26 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +14231 pull_request: https://github.com/python/cpython/pull/14418 ___ Python tracker ___

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread STINNER Victor
STINNER Victor added the comment: New changeset 848acf7249b5669d73d70a7cb6e5ab60689cf825 by Victor Stinner in branch 'master': bpo-35389: test.pythoninfo logs platform.libc_ver (GH-10951) https://github.com/python/cpython/commit/848acf7249b5669d73d70a7cb6e5ab60689cf825 --

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread STINNER Victor
Change by STINNER Victor : -- pull_requests: +10201 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread STINNER Victor
STINNER Victor 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

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread Marc-Andre Lemburg
Marc-Andre Lemburg added the comment: Nice. I never liked the "parse the executable approach", but there wasn't anything better available at the time. -- nosy: +lemburg ___ Python tracker

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread STINNER Victor
STINNER Victor added the comment: > Quick benchmark on Fedora 29: > python3 -m perf command ./python -S -c 'import platform; platform.libc_ver()' > 94.9 ms +- 4.3 ms -> 33.2 ms +- 1.4 ms: 2.86x faster (-65%) Oops, my benchmark in the commit message was wrong, it includes the startup time...

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread STINNER Victor
Change by STINNER Victor : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker ___

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-05 Thread STINNER Victor
STINNER Victor added the comment: New changeset 476b113ed8531b9fbb0bd023a05eb3af21996600 by Victor Stinner in branch 'master': bpo-35389: platform.libc_ver() uses os.confstr() (GH-10891) https://github.com/python/cpython/commit/476b113ed8531b9fbb0bd023a05eb3af21996600 --

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-04 Thread STINNER Victor
STINNER Victor added the comment: > Currently libc_ver() can be used for other executable. See issue26544 for > discussion about libc_ver(). Oh, my PR had a bug: it ignores executable. Fixed: it now only uses os.confstr() if the executable argument is not set. --

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-04 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Currently libc_ver() can be used for other executable. See issue26544 for discussion about libc_ver(). -- nosy: +serhiy.storchaka ___ Python tracker

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-04 Thread STINNER Victor
Change by STINNER Victor : -- keywords: +patch pull_requests: +10130 stage: -> patch review ___ Python tracker ___ ___

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-03 Thread STINNER Victor
STINNER Victor added the comment: > >>> os.confstr('CS_GNU_LIBC_VERSION') > 'glibc 2.28' That's cool because it doesn't require to write new C code ;-) -- ___ Python tracker

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-03 Thread Jakub Wilk
Jakub Wilk added the comment: You can use confstr to get (running) glibc version: >>> os.confstr('CS_GNU_LIBC_VERSION') 'glibc 2.28' -- nosy: +jwilk ___ Python tracker ___

[issue35389] Use gnu_get_libc_version() in platform.libc_ver()?

2018-12-03 Thread STINNER Victor
New submission from STINNER Victor : Currently, platform.libc_ver() opens Python binary file (ex: /usr/bin/python3) and looks for a string like "GLIBC-2.28". Maybe gnu_get_libc_version() should be exposed in Python to get the version of the running glibc version? And use it if available, or