This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: platform.linux_distribution() doesn't recognize Amazon Linux
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, Lorin.Hochstein, lemburg, petr.viktorin
Priority: normal Keywords: patch

Created on 2013-08-28 20:59 by Lorin.Hochstein, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
amazon-linux.patch Lorin.Hochstein, 2013-08-29 00:59 review
Messages (5)
msg196420 - (view) Author: Lorin Hochstein (Lorin.Hochstein) Date: 2013-08-28 20:59
Amazon EC2 has their own Fedora-like Linux distribution (http://aws.amazon.com/amazon-linux-ami/). This distribution isn't recognized by platform.linux_distribution():

>>> import platform
>>> platform.linux_distribution()
('', '', '')

$ cat /etc/issue
Amazon Linux AMI release 2013.03
Kernel \r on an \m

Tested on Python 2.6.8.
msg196423 - (view) Author: Lorin Hochstein (Lorin.Hochstein) Date: 2013-08-28 21:11
$ cat /etc/system-release
Amazon Linux AMI release 2013.03
msg196440 - (view) Author: Lorin Hochstein (Lorin.Hochstein) Date: 2013-08-29 00:59
Adding 'system' as one of the supported distros does the trick.

>>> platform.linux_distribution(supported_dists=['system'])
('Amazon Linux AMI', '2013.03', '')

Simple patch attached.
msg221055 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-20 00:06
The patch adds 'system' to _supported_dists in platform.py.  I've no idea whether or not this is acceptable.
msg317691 - (view) Author: Petr Viktorin (petr.viktorin) * (Python committer) Date: 2018-05-25 17:21
linux_distribution is removed in Python 3.8.
History
Date User Action Args
2022-04-11 14:57:50adminsetgithub: 63072
2018-05-25 17:21:18petr.viktorinsetstatus: open -> closed

nosy: + petr.viktorin
messages: + msg317691

resolution: out of date
stage: resolved
2014-06-20 06:14:30ned.deilysetnosy: + lemburg
2014-06-20 00:06:21BreamoreBoysettype: behavior -> enhancement

messages: + msg221055
nosy: + BreamoreBoy
2013-08-29 00:59:37Lorin.Hochsteinsetfiles: + amazon-linux.patch
keywords: + patch
messages: + msg196440
2013-08-28 21:11:40Lorin.Hochsteinsetmessages: + msg196423
2013-08-28 20:59:44Lorin.Hochsteincreate