[issue28468] Add platform.linux_os_release()

2020-11-24 Thread Christian Heimes
Change by Christian Heimes : -- pull_requests: +22381 pull_request: https://github.com/python/cpython/pull/23492 ___ Python tracker ___

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread R. David Murray
R. David Murray added the comment: Sorry, it wasn't my intent to (re)start a flame war, just to point out that there are linux platforms in wide use that do not support systemd. But I don't have an opinion on whether or not adding this function is a good idea or not. -- _

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: We need a fallback in the case where /etc/os-release does not exists, or just use hasattr on `platform` if hasattr(platform, 'linux_os_release'): print(platform.linux_os_release()) else: ... or just raise an exception if platform.linux_os_release is not

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Christian Heimes
Christian Heimes added the comment: ETOOMUCHBIKESHEDDING and another uncalled systemd flame wars. -- resolution: -> wont fix status: open -> closed ___ Python tracker ___ __

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread R. David Murray
R. David Murray added the comment: I hate systemd. So does the company I'm currently doing most of my work for. We're using centos6 because it doesn't have systemd. I personally use gentoo without systemd. That said, I don't use the platform module, so this doesn't actually affect me. --

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Matthias Klose
Matthias Klose added the comment: "The name of the function clearly indicats that the function only works on Linux with a os-release file." No, it does not. That would be linux_distribution_with_os_release_file(). -- ___ Python tracker

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Christian Heimes
Christian Heimes added the comment: Please read the title of this issue. It is "Add platform.linux_os_release()". The name of the function clearly indicats that the function only works on Linux with a os-release file. -- ___ Python tracker

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Matthias Klose
Matthias Klose added the comment: "Since all major Linux distribution now use systemd, it makes sense to me to add such function." I'm not aware of any embedded Linux distro using systemd (no, I don't consider Raspian an embedded Linux distro). --

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: "This is not available everywhere, not even on Linux distributions. Why would you implement something which only works on 50% of existing Linux distributions?" According to http://0pointer.de/blog/projects/os-release systemd requires /etc/os-release. Since al

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread STINNER Victor
STINNER Victor added the comment: Can you elaborate the expected API? /etc/os-release is not a single line, but a list of variables. Example on my Fedora 24: --- $ cat /etc/os-release NAME=Fedora VERSION="24 (Workstation Edition)" ID=fedora VERSION_ID=24 PRETTY_NAME="Fedora 24 (Workstation Edit

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Matthias Klose
Matthias Klose added the comment: -1 This is not available everywhere, not even on Linux distributions. Why would you implement something which only works on 50% of existing Linux distributions? Who would even use that? And for what would you use it? You have a distro module available now fr

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Christian Heimes
Christian Heimes added the comment: I'm not suggesting a generic platform detection function but rather a limited function just for os-release. On platforms without /etc/os-release the function should obviously fail and raise an exception. /etc/os-release is available on distributions without

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Charalampos Stratakis
Charalampos Stratakis added the comment: Also there is an external project now aiming to provide this functionality: https://github.com/nir0s/distro -- nosy: +cstratak ___ Python tracker __

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Stéphane Wirtel
Stéphane Wirtel added the comment: and for the older distributions without Systemd ? What do you suggest ? -- nosy: +matrixise ___ Python tracker ___

[issue28468] Add platform.linux_os_release()

2016-10-18 Thread Christian Heimes
New submission from Christian Heimes: #1322 has deprecated platform.linux_distribution(). The feature is going to be removed without replacement functions in the stdlib. It's no longer possible to detect the Linux distribution from stdlib. Let's add a function to read /etc/os-release [1] inste