Closed Bug 1621226 Opened 6 years ago Closed 6 years ago

Support python3.8 in mozinfo

Categories

(Testing :: Mozbase, defect, P3)

defect

Tracking

(Not tracked)

RESOLVED DUPLICATE of bug 1595220

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

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.

Blocks: mozbase-py3
Priority: -- → P3

(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.

Flags: needinfo?(svillar)

(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, 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.

Awesome, do you know which was the first release with that piece of code?

Flags: needinfo?(svillar)

(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, 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.

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.

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?

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)

Status: UNCONFIRMED → RESOLVED
Closed: 6 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.