classification
Title: platform.linux_distribution detects Oracle Linux as Red Hat Enterprise Linux
Type: behavior Stage: resolved
Components: Library (Lib) Versions: Python 3.3, Python 3.4, Python 2.7, Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: eric.araujo, georg.brandl, javawizard, lemburg, petr.viktorin, pitrou, python-dev, r.david.murray, terry.reedy, westley.martinez
Priority: normal Keywords: patch

Created on 2013-10-09 21:14 by javawizard, last changed 2018-05-25 17:20 by petr.viktorin. 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
2018-05-25 17:20:47petr.viktorinsetmessages: + msg317690
2018-05-25 17:18:16petr.viktorinsetstatus: open -> closed

nosy: + petr.viktorin
messages: + msg317688

resolution: out of date
stage: patch review -> resolved
2018-04-28 15:15:30python-devsetkeywords: + patch
stage: patch review
pull_requests: + pull_request6322
2013-10-18 01:12:38r.david.murraysetnosy: + georg.brandl, terry.reedy, pitrou, eric.araujo, westley.martinez, python-dev

messages: + msg200180
versions: + Python 2.7, Python 3.4
2013-10-17 23:58:17javawizardsetmessages: + msg200178
2013-10-16 20:54:39r.david.murraysetmessages: + msg200087
2013-10-16 20:29:46javawizardsetfiles: + oracle-release

messages: + msg200083
2013-10-09 22:05:16r.david.murraysetnosy: + r.david.murray, lemburg
messages: + msg199352
2013-10-09 21:14:58javawizardcreate