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

Charles-François Natali report at bugs.python.org
Mon Jun 13 16:51:12 CEST 2011


Charles-François Natali <neologix at free.fr> added the comment:

> I would expect changing sys.platform will also break a lot of third-
> party code.

Maybe, but this would be an application bug.

Here's sys.platform current implementation:

const char *
Py_GetPlatform(void)
{
    return PLATFORM;
}


And here's the documentation, from http://docs.python.org/c-api/init.html

"""
Return the platform identifier for the current platform. On Unix, this is formed from the “official” name of the operating system, converted to lower case, followed by the major revision number"""

So it's actually documented.

> Perhaps sys.platform can still be 'linux2' under Linux 3.x? After
> all, there's no significant change that deserves changing
> sys.platform.

Sounds like a recipe for confusion.

----------

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


More information about the Python-bugs-list mailing list