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

Missing code in linux_distribution python 2.7.11 #70410

Closed
RasmusRynningRasmussen mannequin opened this issue Jan 27, 2016 · 4 comments
Closed

Missing code in linux_distribution python 2.7.11 #70410

RasmusRynningRasmussen mannequin opened this issue Jan 27, 2016 · 4 comments
Labels
stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@RasmusRynningRasmussen
Copy link
Mannequin

RasmusRynningRasmussen mannequin commented Jan 27, 2016

BPO 26222
Nosy @terryjreedy, @kdwyer, @vadmium

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 2016-01-30.09:53:28.125>
created_at = <Date 2016-01-27.17:45:27.991>
labels = ['invalid', 'type-bug', 'library']
title = 'Missing code in linux_distribution python 2.7.11'
updated_at = <Date 2016-01-30.09:53:28.124>
user = 'https://bugs.python.org/RasmusRynningRasmussen'

bugs.python.org fields:

activity = <Date 2016-01-30.09:53:28.124>
actor = 'berker.peksag'
assignee = 'none'
closed = True
closed_date = <Date 2016-01-30.09:53:28.125>
closer = 'berker.peksag'
components = ['Library (Lib)']
creation = <Date 2016-01-27.17:45:27.991>
creator = 'Rasmus Rynning Rasmussen'
dependencies = []
files = []
hgrepos = []
issue_num = 26222
keywords = []
message_count = 4.0
messages = ['259037', '259128', '259159', '259232']
nosy_count = 4.0
nosy_names = ['terry.reedy', 'kdwyer', 'martin.panter', 'Rasmus Rynning Rasmussen']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue26222'
versions = ['Python 2.7']

@RasmusRynningRasmussen
Copy link
Mannequin Author

RasmusRynningRasmussen mannequin commented Jan 27, 2016

During the transition from python 2.7.10 to 2.7.11 some code seems to have been lost. platform.linux_distribution() is not able to recognise Debian based distributions in python 2.7.11.

The following code was present in platform.py, python 2.7.10, but seems to be missing in 2.7.11

# check for the LSB /etc/lsb-release file first, needed so
# that the distribution doesn't get identified as Debian.
try:
with open("/etc/lsb-release", "rU") as etclsbrel:
for line in etclsbrel:
m = _distributor_id_file_re.search(line)
if m:
_u_distname = m.group(1).strip()
m = _release_file_re.search(line)
if m:
_u_version = m.group(1).strip()
m = _codename_file_re.search(line)
if m:
_u_id = m.group(1).strip()
if _u_distname and _u_version:
return (_u_distname, _u_version, _u_id)
except (EnvironmentError, UnboundLocalError):
pass

@RasmusRynningRasmussen RasmusRynningRasmussen mannequin added performance Performance or resource usage build The build process and cross-build labels Jan 27, 2016
@kdwyer
Copy link
Mannequin

kdwyer mannequin commented Jan 28, 2016

The quoted code doesn't exist in 2.7.10 (https://hg.python.org/cpython/file/v2.7.10/Lib/platform.py)

It looks like it's from a patch applied by Debian themselves: see http://sources.debian.net/src/python2.7/2.7.11-3/debian/patches/platform-lsbrelease.diff/?hl=33#L33

@kdwyer kdwyer mannequin added type-bug An unexpected behavior, bug, or error and removed performance Performance or resource usage labels Jan 28, 2016
@vadmium
Copy link
Member

vadmium commented Jan 28, 2016

I think Kevin is right. Debian often carries its own downstream patches. In this case, the patch was proposed in bpo-9514, which is closed as “won’t fix”. In Python 3, linux_distribution() is apparently deprecated (bpo-1322).

@vadmium vadmium added stdlib Python modules in the Lib dir and removed build The build process and cross-build labels Jan 28, 2016
@terryjreedy
Copy link
Member

From the last two comments, it looks like this should be closed as 'not a bug'.

@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

3 participants