Open Bug 1212502 Opened 4 years ago Updated 11 months ago

Prepare in mozinfo for platform.linux_distribution() going away in python 3.7


(Testing :: Mozbase, defect)

Not set


(Not tracked)


(Reporter: aceman, Unassigned)


The function linux_distribution() in the of Python seems to be going away in Python 3.7

See: and

Also, in python 2.7 the function is returning empty distro/version on distros that have the /etc directory not world readable (only executable/enterable). See bug 1117543. Yes, this should be fixed in (for 2.7) but it seems they no longer accept fixes for this code (see final comments of

So I propose to prepare to find other solution for finding this info if mozinfo and tests really need to know the distro version being run.
The timetable for the build system and Firefox automation supporting Python 3 is likely measured in years.
As per the python documentation, platform.linux_distribution() will be removed in python 3.8.

A pip package 'distro' has been named as an alternative:

Looks like this is a drop-in replacement for the platform.linux_distribution() call.
You need to log in before you can comment on or make changes to this bug.