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



3 years ago
2 months ago


(Reporter: aceman, Unassigned)


Firefox Tracking Flags

(Not tracked)




3 years ago
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.

Comment 2

2 months ago
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.