Good morning all,
We have started a discussion today, no? ;-)
On 23 Jan, 2013, at 09:00, Stijn De Weirdt wrote:
> euhm, well, windows support is a bit broken ;)
Well, that must have been an artifact of v3.x:
(eg. prefer to use linux_distribution() instead)
Even on Debian you will get:
fgeorgatos@gaia-10:~$ lsb_release -a
LSB Version:
core-2.0-amd64:core-2.0-noarch:core-3.0-amd64:core-3.0-noarch:core-3.1-amd64:core-3.1-noarch:core-3.2-amd64:core-3.2-noarch:desktop-3.1-amd64:desktop-3.1-noarch:desktop-3.2-amd64:desktop-3.2-noarch:graphics-2.0-amd64:graphics-2.0-noarch:graphics-3.0-amd64:graphics-3.0-noarch:graphics-3.1-amd64:graphics-3.1-noarch:graphics-3.2-amd64:graphics-3.2-noarch:qt4-3.1-amd64:qt4-3.1-noarch
Distributor ID: Debian
Description: Debian GNU/Linux 6.0.6 (squeeze)
Release: 6.0.6
Codename: squeeze
fgeorgatos@gaia-10:~$ module load Python/2.7.3-goalf-1.1.0-no-OFED
fgeorgatos@gaia-10:~$ python
Python 2.7.3 (default, Dec 18 2012, 07:01:29)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print platform.dist()
('debian', '6.0.6', '')
>>>
fgeorgatos@gaia-10:~$ module swap Python Python/3.2.3-goalf-1.1.0-no-OFED
fgeorgatos@gaia-10:~$ python
Python 3.2.3 (default, Dec 18 2012, 09:42:48)
[GCC 4.6.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import platform
>>> print platform.dist()
File "<stdin>", line 1
print platform.dist()
^
SyntaxError: invalid syntax
>>>
[...] # Let's try it now with the linux_distribution() function
>>> from platform import linux_distribution
>>> linux_distribution()
('debian', '6.0.6', '')
btw.
the most "standards-compliant" way to retrieve the OS/distribution in the Linux
world
is to use the LSB convention; a side-effect of it though, is that in the current
implementations, the packages have not been greatly factorized and the
dependencies
of LSB are a little bit massive (many MBs) so sysadmins do not look favorably
to it.
eg. Why should we install libraries on graphics, just to get the distro minor
version?
OTOH, this is expected to change when v5 get picked up or something like that.
cheers,
Fotis