New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform.dist(): detect Linux distribution version in a robust, standard way #48187
Comments
platform.dist() returns ('debian', 'lenny/sid', '') on my Ubuntu 8.04 http://refspecs.freestandards.org/LSB_1.0.0/gLSB/lsbrelease.html and currently standardized here: http://refspecs.freestandards.org/LSB_3.2.0/LSB-Core-generic/LSB-Core-generic/lsbrelease.html If invoking "lsb_release" results in exit code 0 and some non-empty, There is a drawback to this: invoking three successive subprocesses With this patch, platform.dist() return: Oh, this patch also updates the docstring of dist() to explain what is |
Here's a new version of this patch which differs only in having slightly |
Please take a look at bpo-1322 for some discussion on this topic. |
Here is an updated version of my patch which tries parsing |
Here are the results of that. Summary: looks fine to me. http://tahoe-lafs.org/buildbot/waterfall Here are the scripts that are generating these results: http://tahoe-lafs.org/trac/tahoe-lafs/browser/trunk/src/allmydata/__init__.py?rev=4687#L80 The relevant parts of the results are summarized below: http://tahoe-lafs.org/buildbot/builders/Eugen lenny-amd64 platform: Linux-2.6.26-1-vserver-amd64-x86_64-with-debian-5.0.5 python: 2.5.2 (r252:60911, Jan 24 2010, 17:44:40) [GCC 4.3.2] platform: Linux-debian_5.0.5-x86_64-64bit http://tahoe-lafs.org/buildbot/builders/hardy-amd64 platform: Linux-2.6.32-24-server-x86_64-with-Ubuntu-10.04-lucid python: 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] platform: Linux-Ubuntu_10.04-x86_64-64bit_ELF http://tahoe-lafs.org/buildbot/builders/Shawn jaunty amd64 platform: Linux-2.6.32-24-generic-x86_64-with-Ubuntu-10.04-lucid python: 2.6.5 (r265:79063, Apr 16 2010, 13:57:41) [GCC 4.4.3] platform: Linux-Ubuntu_10.04-x86_64-64bit_ELF http://tahoe-lafs.org/buildbot/builders/Zooko ubuntu-amd64 yukyuk platform: Linux-2.6.32.8yukyuk36-x86_64-with-Ubuntu-10.04-lucid python: 2.6.4+ (r264:75706, Feb 16 2010, 02:54:39) [GCC 4.4.3], maxunicode: 1114111 platform: Linux-Ubuntu_10.04-x86_64-64bit_ELF http://tahoe-lafs.org/buildbot/builders/Ruben Fedora platform: Linux-2.6.33.5-rscloud-x86_64-with-fedora-15-Rawhide python: 2.7 (r27:82500, Jul 26 2010, 18:19:48) [GCC 4.5.0 20100716 (Red Hat 4.5.0-3)] platform: Linux-fedora_15-x86_64-64bit_ELF http://tahoe-lafs.org/buildbot/builders/Arthur lenny c7 32bit platform: Linux-2.6.24dedibox-r8-c7-i686-with-debian-5.0.5 python: 2.5.2 (r252:60911, Jan 24 2010, 14:53:14) [GCC 4.3.2] platform: Linux-debian_5.0.5-i686-32bit http://tahoe-lafs.org/buildbot/builders/David A. OpenSolaris i386 platform: SunOS-5.11-i86pc-i386-32bit python: 2.5.2 (r252:60911, Mar 11 2009, 04:50:47) [C] platform: SunOS-5.11-i86pc-i386-32bit http://tahoe-lafs.org/buildbot/builders/Randy FreeBSD-amd64 platform: FreeBSD-8.1-STABLE-amd64-64bit-ELF python: 2.5.5 (r255:77872, Mar 12 2010, 08:40:28) [GCC 4.2.1 20070719 [FreeBSD]] http://tahoe-lafs.org/buildbot/builders/Kyle OpenBSD-4.6 amd64 platform: OpenBSD-4.6-amd64-Genuine_Intel-R-CPU_000@_2.93GHz-64bit-ELF python: 2.6.2 (r262:71600, Jul 4 2009, 23:29:57) [GCC 3.3.5 (propolice)] platform: OpenBSD-4.6-amd64-Genuine_Intel-R-CPU_000@_2.93GHz-64bit-ELF http://tahoe-lafs.org/buildbot/builders/Ludo NixOS-amd64 platform: Linux-2.6.32.13-x86_64-with-glibc2.2.5 http://tahoe-lafs.org/buildbot/builders/MM netbsd5 i386 warp platform: NetBSD-5.0.2-i386-32bit-ELF python: 2.6.5 (r265:79063, Jun 23 2010, 11:07:30) [GCC 4.1.3 20080704 prerelease (NetBSD nb2 20081120)] , maxunicode: 65535 platform: NetBSD-5.0.2-i386-32bit-ELF http://tahoe-lafs.org/buildbot/builders/FranXois lenny-armv5tel platform: Linux-2.6.32-trunk-iop32x-armv5tel-with-debian-squeeze-sid python: 2.6.5+ (release26-maint, Jul 7 2010, 00:21:05) [GCC 4.4.4] platform: Linux-debian_squeeze/sid-armv5tel-32bit_ELF http://tahoe-lafs.org/buildbot/builders/FreeStorm CentOS5-i386 platform: Linux-2.6.18-194.8.1.el5-i686-athlon-with-redhat-5.5-Final python: 2.4.3 (#1, Sep 3 2009, 15:37:12) [GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] platform: Linux-redhat_5.5-i686-32bit_ELF http://tahoe-lafs.org/buildbot/builders/zooko ootles Mac-amd64 10.4 platform: Darwin-8.11.1-i386-32bit python: 2.5.4 (release25-maint:72153M, Apr 30 2009, 12:28:20) [GCC 4.0.1 (Apple Computer, Inc. build 5367)] platform: Darwin-8.11.1-i386-32bit http://tahoe-lafs.org/buildbot/builders/Zooko zomp Mac-amd64 10.6 py2.6 platform: Darwin-10.4.0-i386-64bit python: 2.6.1 (r261:67515, Feb 11 2010, 00:51:29) [GCC 4.2.1 (Apple Inc. build 5646)] platform: Darwin-10.4.0-i386-64bit http://tahoe-lafs.org/buildbot/builders/FreeStorm WinXP-x86 py2.6 platform: Windows-XP-5.1.2600-SP3 python: 2.6.5 (r265:79096, Mar 19 2010, 21:48:26) [MSC v.1500 32 bit (Intel)] platform: Windows-XP-5.1.2600-SP3 http://tahoe-lafs.org/buildbot/builders/FreeStorm Win7-amd64-mingw py2.6 platform: Windows-post2008Server-6.1.7600 python: 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] http://tahoe-lafs.org/buildbot/builders/Soultcer Win7-64 py2.6 platform: Windows-post2008Server-6.1.7600 python: 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] http://tahoe-lafs.org/buildbot/builders/Dcoder Win7-64 py2.6 platform: Windows-post2008Server-6.1.7600 python: 2.6.5 (r265:79096, Mar 19 2010, 18:02:59) [MSC v.1500 64 bit (AMD64)] platform: Windows-post2008Server-6.1.7600 |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: