Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

platform.linux_distribution() returns empty value on Archlinux and python 2.7 #64653

Closed
fmoreau mannequin opened this issue Jan 31, 2014 · 7 comments
Closed

platform.linux_distribution() returns empty value on Archlinux and python 2.7 #64653

fmoreau mannequin opened this issue Jan 31, 2014 · 7 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@fmoreau
Copy link
Mannequin

fmoreau mannequin commented Jan 31, 2014

BPO 20454
Nosy @malemburg, @bitdancer, @encukou

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2018-05-25.17:17:01.790>
created_at = <Date 2014-01-31.11:02:45.496>
labels = ['type-bug', 'library']
title = 'platform.linux_distribution() returns empty value on Archlinux and python 2.7'
updated_at = <Date 2018-05-25.17:20:40.494>
user = 'https://bugs.python.org/fmoreau'

bugs.python.org fields:

activity = <Date 2018-05-25.17:20:40.494>
actor = 'petr.viktorin'
assignee = 'none'
closed = True
closed_date = <Date 2018-05-25.17:17:01.790>
closer = 'petr.viktorin'
components = ['Library (Lib)']
creation = <Date 2014-01-31.11:02:45.496>
creator = 'fmoreau'
dependencies = []
files = []
hgrepos = []
issue_num = 20454
keywords = []
message_count = 7.0
messages = ['209764', '237626', '241212', '241280', '244927', '317687', '317689']
nosy_count = 7.0
nosy_names = ['lemburg', 'r.david.murray', 'petr.viktorin', 'BreamoreBoy', 'fmoreau', 'ha034', 'Nathan Ringo']
pr_nums = []
priority = 'normal'
resolution = 'out of date'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue20454'
versions = ['Python 2.7']

@fmoreau
Copy link
Mannequin Author

fmoreau mannequin commented Jan 31, 2014

On Archlinux:

$ python2.7 -c 'import platform; print(platform.linux_distribution())'
('', '', '')

This is because Archlinux is not part of the '_supported_dists' list.

Could Archlinux be added to this list ?

Thanks.

@fmoreau fmoreau mannequin added stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Jan 31, 2014
@BreamoreBoy
Copy link
Mannequin

BreamoreBoy mannequin commented Mar 9, 2015

Can Archlinux be added to _supported_dists as requested in msg209764, I've no understanding of the criteria involved here?

@ha034
Copy link
Mannequin

ha034 mannequin commented Apr 16, 2015

Hey guys,

Just add:

    if os.path.exists('/etc/arch-release'):
        distname = 'arch'

in "_dist_try_harder"

then replace the old list with this one:

_supported_dists = (
    'SuSE', 'debian', 'fedora', 'redhat', 'centos',
    'mandrake', 'mandriva', 'rocks', 'slackware', 'yellowdog', 'gentoo',
    'UnitedLinux', 'turbolinux', 'arch')

And that's it, it works.

@bitdancer
Copy link
Member

Since the direction we are heading seems to toward deprecating linux_distribution (see http://bugs.python.org/issue1322#msg207427), I think this issue should be closed.

@NathanRingo
Copy link
Mannequin

NathanRingo mannequin commented Jun 6, 2015

The problem is, existing software (Ansible) relies on linux_distribution()

@encukou
Copy link
Member

encukou commented May 25, 2018

linux_distribution is removed in Python 3.7.
Closing.

@encukou encukou closed this as completed May 25, 2018
@encukou
Copy link
Member

encukou commented May 25, 2018

Er, sorry, I meant in 3.8.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

2 participants