[issue1322] platform.dist() has unpredictable result under Linux

Christian Heimes report at bugs.python.org
Tue Oct 30 13:03:56 CET 2007


Christian Heimes added the comment:

Yann Cointepas wrote:
> I joined a modified version of platform.py. Here is a summary of the
> modification:
> - replaced '/etc' by global variable _etc_dir
> - removed supported_dists parameter of dist()
> - each element of dist() result is searched in the following places
>   (the first value found is kept):
>   1) First line of /etc/<distribname>-release
>   2) Contents of /etc/lsb-release
>   3) Extract <distribname> from /etc/<distribname>-release

Here is an updated patch against Python 2.5 (your file was based on
Python 2.5's platform.py, wasn't it?).

CHANGES:

 * Added unit tests
 * Add Lib/test/platform directory for unit tests
 * removed usage of string
 * minor cleanups

Now for the funny part. You have to port the patch to the svn trunk. The
file can't be altered in the 2.5 release cycle. The changes are too
great. Unfortunately the patch doesn't apply cleanly.

Please add more test data to the platform/ directory and test_platform.py

In order to build the trunk:
svn co http://svn.python.org/projects/python/trunk
cd trunk
./configure
make
patch -p0 < patchfile
./python Lib/test/test_platform.py
svn diff > patchfile

Christian

__________________________________
Tracker <report at bugs.python.org>
<http://bugs.python.org/issue1322>
__________________________________


More information about the Python-bugs-list mailing list