Support python3.8 in mozinfo
Categories
(Testing :: Mozbase, defect, P3)
Tracking
(Not tracked)
People
(Reporter: svillar, Unassigned)
References
Details
User Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/13.0 Safari/605.1.15 Epiphany/605.1.15
Steps to reproduce:
Run mozinfo in a python3.8 shell
Actual results:
if hasattr(platform, "linux_distribution"):
(distro, os_version, codename) = platform.linux_distribution()
else:
(distro, os_version, codename) = platform.dist()
E AttributeError: module 'platform' has no attribute 'dist'
Expected results:
No error.
The problem is that both linux_distribution() and dist() were deprecated in python3.5 and effectively removed in python3.8
| Reporter | ||
Comment 1•6 years ago
|
||
Oh I hadn't realized about the comment block just about the code:
# Attempt to use distro package to determine Linux distribution first.
# Failing that, fall back to use the platform method.
# Note that platform.linux_distribution() will be deprecated as of 3.8
# and this block will be removed once support for 2.7/3.5 is dropped.
So I guess it's expected behaviour. Anyway I guess it's good to leave this open to track the issue.
| Reporter | ||
Updated•6 years ago
|
Updated•6 years ago
|
Comment 2•6 years ago
•
|
||
(In reply to Sergio Villar from comment #1)
Oh I hadn't realized about the comment block just about the code:
# Attempt to use distro package to determine Linux distribution first. # Failing that, fall back to use the platform method. # Note that platform.linux_distribution() will be deprecated as of 3.8 # and this block will be removed once support for 2.7/3.5 is dropped.So I guess it's expected behaviour. Anyway I guess it's good to leave this open to track the issue.
FYI, mozinfo has been updated with that whole section updated and rewritten some months back:
https://searchfox.org/mozilla-central/source/testing/mozbase/mozinfo/mozinfo/mozinfo.py#101-123
Please try running pip install --upgrade mozinfo to get the current version.
| Reporter | ||
Comment 3•6 years ago
|
||
(In reply to Edwin Takahashi (:egao) from comment #2)
(In reply to Sergio Villar from comment #1)
Oh I hadn't realized about the comment block just about the code:
# Attempt to use distro package to determine Linux distribution first. # Failing that, fall back to use the platform method. # Note that platform.linux_distribution() will be deprecated as of 3.8 # and this block will be removed once support for 2.7/3.5 is dropped.So I guess it's expected behaviour. Anyway I guess it's good to leave this open to track the issue.
FYI,
mozinfohas been updated with that whole section updated and rewritten some months back:
https://searchfox.org/mozilla-central/source/testing/mozbase/mozinfo/mozinfo/mozinfo.py#101-123Please try running
pip install --upgrade mozinfoto get the current version.
Awesome, do you know which was the first release with that piece of code?
Comment 4•6 years ago
|
||
(In reply to Sergio Villar from comment #3)
(In reply to Edwin Takahashi (:egao) from comment #2)
(In reply to Sergio Villar from comment #1)
Oh I hadn't realized about the comment block just about the code:
# Attempt to use distro package to determine Linux distribution first. # Failing that, fall back to use the platform method. # Note that platform.linux_distribution() will be deprecated as of 3.8 # and this block will be removed once support for 2.7/3.5 is dropped.So I guess it's expected behaviour. Anyway I guess it's good to leave this open to track the issue.
FYI,
mozinfohas been updated with that whole section updated and rewritten some months back:
https://searchfox.org/mozilla-central/source/testing/mozbase/mozinfo/mozinfo/mozinfo.py#101-123Please try running
pip install --upgrade mozinfoto get the current version.Awesome, do you know which was the first release with that piece of code?
I do not remember with 100% accuracy but I believe it is 1.2.0.
Comment 5•6 years ago
|
||
The appropriate diff shows version 1.2.1:
https://hg.mozilla.org/mozilla-central/rev/3d5e40454c304b5614cb5725c3f5d8cab82c7be3#l2.13
So I think we can get this bug closed?
| Reporter | ||
Comment 6•6 years ago
|
||
Sure, thank you very much.
(I can only close as INVALID or DUPLICATE, so feel free to close it, not sure there is a ALREADYFIXED or the like)
Updated•6 years ago
|
Description
•