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

Marc-Andre Lemburg report at bugs.python.org
Fri Apr 22 00:02:41 CEST 2011


Marc-Andre Lemburg <mal at egenix.com> added the comment:

Éric Araujo wrote:
> 
> Éric Araujo <merwok at netwok.org> added the comment:
> 
> [Zooko]
>> I just read back through this ticket, but I didn't understand exactly
>> what MAL wanted to have different from what this Python function
>> currently does:
> 
> It may be this:
> 
>> It's better to follow the approach taken by lsb_release and then
>> add calling lsb_release as one of the methods taken by
>> _dist_try_harder() (using platform.popen()) should the parsers
>> fail.
>> This avoids spawning a process in most cases.

Indeed.

You also need to make sure that the function doesn't suddenly
return different output for setups that are supported and work
as advertised.

Note that the Debian mention in the string output is not really
incorrect, given that Ubuntu and other distros are based on the
work done by the Debian project.

Looking back, I shouldn't have added the function to begin
with and just use "Linux" in the platform string. It's causing
too much maintenance overhead.
Perhaps deprecating it altogether is more appropriate.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1322>
_______________________________________


More information about the Python-bugs-list mailing list