Closed Bug 1595220 Opened 5 years ago Closed 5 years ago

[mozinfo] distro.linux_platform has different output compared to platform.linux_distribution

Categories

(Testing :: Mozbase, defect, P3)

defect

Tracking

(firefox72 fixed)

RESOLVED FIXED
mozilla72
Tracking Status
firefox72 --- fixed

People

(Reporter: egao, Assigned: egao)

References

Details

Attachments

(1 file)

With mozinfo 1.2.0 release the distro package is now the primary method used to provide the value for linux_distribution.

My assumption that it was a straight drop-in replacement was incorrect however. The output slightly differs as seen below:

>>> import platform
>>> platform.linux_distribution()
('debian', '10.1', '')
>>> import distro
>>> distro.linux_distribution()
(u'Debian GNU/Linux', u'10', u'buster')

Therefore it may be required to perform some or all of the following adjustments to the outputs:

  • lowercase the output
  • trim/prune

Additionally or alternatively:

  • more tests should be written to catch this case.
  • consider removing entirely the usage of platform module (even though python2.7 and python3.5 still supports platform)
Summary: distro.linux_platform has different output compared to platform.linux_distribution → [mozinfo] distro.linux_platform has different output compared to platform.linux_distribution
Priority: -- → P4
Version: Version 3 → unspecified
Attachment #9107654 - Attachment description: Bug 1595220 - sanitize output of distro/platform linux_distribution call → Bug 1595220 - streamline and sanitize output of distro/platform linux_distribution call in mozinfo
Priority: P4 → P3
Attachment #9107654 - Attachment description: Bug 1595220 - streamline and sanitize output of distro/platform linux_distribution call in mozinfo → Bug 1595220 - sanitize output of distro/platform linux_distribution call
Pushed by egao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/4b4f0fb8292c
streamline and sanitize output of distro/platform linux_distribution call in mozinfo r=jmaher

Not sure why this would change those test results, that seems very strange and unexpected.

Attachment #9107654 - Attachment description: Bug 1595220 - sanitize output of distro/platform linux_distribution call → Bug 1595220 - streamline and sanitize output of distro/platform linux_distribution call in mozinfo
Pushed by egao@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3d5e40454c30
streamline and sanitize output of distro/platform linux_distribution call in mozinfo r=jmaher

Pushed a fixed patch.

Flags: needinfo?(egao)
Status: NEW → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla72
Assignee: nobody → egao
See Also: → 1609483
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: