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

Marc-Andre Lemburg report at bugs.python.org
Thu Aug 18 23:36:56 CEST 2011


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

Some thoughts:

 * We can't change the value of a system variable in a patch level
   release. It's not a bug and the change is not motivated by
   Python, but by the OS vendor. So changes to released versions
   are not possible. They are also not necessary - see the next bullet.

 * Porting to a new OS version is always an application level problem,
   not a programming language one; you cannot expect applications
   written for Linux 2.x to run without problems on 3.x - much like you
   cannot expect Python 2.x applications to run without problems
   on Python 3.x.

 * Removing the version number from the platform string should only
   be done in case a new variable gets introduced that provides the
   full version. Using the platform module would be possible, but
   can be expensive, so having this value as standard sys module
   variable is a better approach.

   Otherwise, removing the version is a good thing to do for
   Python 3.3 onwards.

 * The same change should be applied to *all* other platform strings,
   not only Linux, but the *BSDs and the others as well.

 * Application writers need to be made aware of the change, since
   sys.platform is not only used in Python programs, but also
   to build e.g. path names, file names, log ids, etc. etc.

----------

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


More information about the Python-bugs-list mailing list