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 Edition)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:fedoraproject:fedora:24"
HOME_URL="https://fedoraproject.org/";
BUG_REPORT_URL="https://bugzilla.redhat.com/";
REDHAT_BUGZILLA_PRODUCT="Fedora"
REDHAT_BUGZILLA_PRODUCT_VERSION=24
REDHAT_SUPPORT_PRODUCT="Fedora"
REDHAT_SUPPORT_PRODUCT_VERSION=24
PRIVACY_POLICY_URL=https://fedoraproject.org/wiki/Legal:PrivacyPolicy
VARIANT="Workstation Edition"
VARIANT_ID=workstation
---

I think that you should return a dictionary key=>value. Maybe we can simply 
return an empty dictionary if the file doesn't exist or cannot be read (but 
raise an error on parsing error).

FYI On Fedora 24, /etc/os-release is in fact a symbolic link to a symbolic link:
---
$ ls -l /etc/os-release 
lrwxrwxrwx. 1 root root 21 24 juin  03:25 /etc/os-release -> 
../usr/lib/os-release

$ ls -l /usr/lib/os-release
lrwxrwxrwx. 1 root root 37 13 sept. 09:51 /usr/lib/os-release -> 
./os.release.d/os-release-workstation

$ ls -l /usr/lib/os.release.d/os-release-workstation
-rw-r--r--. 1 root root 518 24 juin  03:25 
/usr/lib/os.release.d/os-release-workstation
---

See also systemd manual page:
https://www.freedesktop.org/software/systemd/man/os-release.html

----------
nosy: +haypo

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28468>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to