I have 2 versions of python installed on some virtual machine 2.7.9
and 2.7.6
. 2.7.6
is installed from system package while 2.7.9
is installed from sources. This machine is running on Ubuntu 14.04.
I wanted to use platform
module to get information about linux distribution. However it turned out that in these 2 versions I got different results of platform.linux_distribution()
.
Python 2.7.9 (...)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.linux_distribution()
('debian', 'jessie/sid', '')
Python 2.7.6 (...)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> platform.linux_distribution()
('Ubuntu', '14.04', 'trusty')
Any idea why it is so?
Or more generally how does platform module get information about linux distribution. Is it based on lsb_relase
or some other system command or is it hardcoded somewhere?