Issue 19213: platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux (original) (raw)

Created on 2013-10-09 21:14 by javawizard, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
oracle-release javawizard,2013-10-16 20:29 /etc/oracle-release
Pull Requests
URL Status Linked Edit
PR 6626 closed python-dev,2018-04-28 15:15
Messages (8)
msg199345 - (view) Author: Alexander Boyd (javawizard) Date: 2013-10-09 21:14
Tested on 3.3.2 and 2.6.6. On Oracle Linux, platform.linux_distribution detects the current distribution as Red Hat Enterprise Linux: >>> import platform >>> platform.linux_distribution() ('Red Hat Enterprise Linux Server', '6.2', 'Santiago') I would have expected something along the lines of: >>> import platform >>> platform.linux_distribution() ('Oracle Linux', '6.2', '') Or perhaps ('Oracle Linux Server', '6.2', '').
msg199352 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-10-09 22:05
You might expect that, but platform.linux_distribution is basing its report on what is in /etc/xxx-version or xxx-release. Most likely this is an Oracle "bug", although they might be providing both their own version file and the version file for the RH release they are basing off of, in which case we could perhaps tweak the platform code to take that into account. Can you figure out which it is?
msg200083 - (view) Author: Alexander Boyd (javawizard) Date: 2013-10-16 20:29
They're providing both /etc/oracle-release and /etc/redhat-release (as Oracle Linux is based on RHEL). I've attached /etc/oracle-release for reference.
msg200087 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-10-16 20:54
Gah. Well, by good fortune 'o' comes before 'r' in the alphabet, so it should be enough to just add 'oracle' to the list of _supported_dists in platform.py. Can you test that and confirm it?
msg200178 - (view) Author: Alexander Boyd (javawizard) Date: 2013-10-17 23:58
Yep, that fixes it.
msg200180 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2013-10-18 01:12
Based on Marc-Andre recommendation at the end of issue 11678, I plan to commit this as a bug fix, and add arch to 2.7 while I'm at it. Unless there are objections.
msg317688 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2018-05-25 17:18
linux_distribution is removed in Python 3.7. Closing.
msg317690 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2018-05-25 17:20
Er, sorry, I meant in 3.8.
History
Date User Action Args
2022-04-11 14:57:51 admin set github: 63412
2018-05-25 17:20:47 petr.viktorin set messages: +
2018-05-25 17🔞16 petr.viktorin set status: open -> closednosy: + petr.viktorinmessages: + resolution: out of datestage: patch review -> resolved
2018-04-28 15:15:30 python-dev set keywords: + patchstage: patch reviewpull_requests: + <pull%5Frequest6322>
2013-10-18 01:12:38 r.david.murray set nosy: + georg.brandl, terry.reedy, pitrou, eric.araujo, westley.martinez, python-devmessages: + versions: + Python 2.7, Python 3.4
2013-10-17 23:58:17 javawizard set messages: +
2013-10-16 20:54:39 r.david.murray set messages: +
2013-10-16 20:29:46 javawizard set files: + oracle-releasemessages: +
2013-10-09 22:05:16 r.david.murray set nosy: + r.david.murray, lemburgmessages: +
2013-10-09 21:14:58 javawizard create