[issue12326] Linux 3: tests should avoid using sys.platform == 'linux2'

Martin v. Löwis report at bugs.python.org
Mon Jun 27 10:05:05 CEST 2011


Martin v. Löwis <martin at v.loewis.de> added the comment:

>> That would be incorrect for some systems. For example, FreeBSD does
>> change sets of symbolic constants across system releases (mostly
>> additions, but sometimes also removals). Back then, SunOS 4 and SunOS
>> 5 were completely unrelated systems.
>>
> 
> Well, I don't see the problem in that case.

What I'm advocating is to special-case Linux (and any other system
where major version numbers don't mean much).

> The point I (and others) have been trying to make is that 99% of the
> time, people using sys.platform really mean platform.system() or
> uname[0], since they're only interested in the operating system, and
> don't care about the release. That's true of the vast majority of such
> occurrences in Lib/test, and probably true of the vast majority of the
> user code base.

I don't argue with that. I agree the code is broken (although I disagree
that platform.system is the right answer in most cases), but that
doesn't help resolving this issue (unless the resolution is "no change",
which I still oppose to).

> Furthermore, at least on Linux, the major version number doesn't mean
> anything

Indeed - hence I propose to drop it from sys.platform if the system
is Linux.

----------

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


More information about the Python-bugs-list mailing list