Closed Bug 615008 Opened 14 years ago Closed 14 years ago

Find alternative for platform.linux_distribution, which requires at least Python 2.6

Categories

(Testing Graveyard :: Mozmill, defect)

x86
Linux
defect
Not set
major

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: Aleksej, Assigned: whimboo)

References

Details

(Keywords: regression, Whiteboard: [MozmillTestday][mozmill-1.5.2+])

Attachments

(2 files)

Running with Python 2.5 can cause a crash, because "linux_distribution" was not available before Python 2.6: http://docs.python.org/library/platform.html?highlight=linux_distribution#platform.linux_distribution

INFO Passed: 2
INFO Failed: 2
INFO Skipped: 0
Traceback (most recent call last):
  File "/usr/bin/mozmill", line 8, in <module>
    load_entry_point('mozmill==1.5.1', 'console_scripts', 'mozmill')()
  File "/usr/lib/python2.5/site-packages/mozmill/__init__.py", line 811, in cli
    CLI().run()
  File "/usr/lib/python2.5/site-packages/mozmill/__init__.py", line 776, in run
    self.mozmill.report(self.options.report)
  File "/usr/lib/python2.5/site-packages/mozmill/__init__.py", line 473, in report
    results = self.get_report()
  File "/usr/lib/python2.5/site-packages/mozmill/__init__.py", line 418, in get_report
    report['system_info'] = self.get_platform_information()
  File "/usr/lib/python2.5/site-packages/mozmill/__init__.py", line 364, in get_platform_information
    (distro, version, codename) = platform.linux_distribution()
AttributeError: 'module' object has no attribute 'linux_distribution'
My fault when I have implemented bug 562822. We still support Python 2.5, and I have simply taken it over from Heather's template.
Assignee: nobody → hskupin
Blocks: 562822
Keywords: regression
Whiteboard: [MozmillTestday] → [MozmillTestday][mozmill-1.5.2?]
Summary: uses platform.linux_distribution, which requires at least Python 2.6 → Find alternative for platform.linux_distribution, which requires at least Python 2.6
I think this can be easily solved by changing platform.linux_distribution() to platform.dist(). Taking.
Whiteboard: [MozmillTestday][mozmill-1.5.2?] → [MozmillTestday][mozmill-1.5.2+]
Attached patch Patch v1Splinter Review
As mentioned lets use the old but deprecated version. Should be fine at least until we support Python 3.
Attachment #495981 - Flags: review?(jhammel)
Comment on attachment 495981 [details] [diff] [review]
Patch v1

Works for me here.  I haven't tested on all python versions.  For 2.0, I'd like to see this as part of the mozinfo package (bug 606524)
Attachment #495981 - Flags: review?(jhammel) → review+
> Works for me here.  I haven't tested on all python versions.  For 2.0, I'd like
> to see this as part of the mozinfo package (bug 606524)

There is a lot more stuff to do for a final implementation. This patch simply updates the code inside of info.py to make sure we do not fail.
Attachment #497645 - Flags: review?(jhammel)
Attachment #497645 - Flags: review?(jhammel) → review+
Landed on master:
https://github.com/mozautomation/mozmill/commit/4c155534445c306fa144d5e6e1b95b211a429b04
Status: ASSIGNED → RESOLVED
Closed: 14 years ago
Resolution: --- → FIXED
Aleksej, could you please verify that it now works? We have pushed Mozmill 1.5.2 RC2 today to pypi, so a "pip install --upgrade mozmill" should update you to that version. Thanks.
Verified fixed. Thanks.
Status: RESOLVED → VERIFIED
Depends on: 630560
Product: Testing → Testing Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: