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

Barry A. Warsaw report at bugs.python.org
Thu Aug 18 17:40:56 CEST 2011


Barry A. Warsaw <barry at python.org> added the comment:

On Aug 18, 2011, at 01:15 PM, Charles-François Natali wrote:

>Charles-François Natali <neologix at free.fr> added the comment:
>
>> My question too!  I would say that stable releases should probably not get
>> this change, but should force sys.platform to linux2 on 3.x kernels.
>
>The point is precisely that we don't change anything: applications
>checking against sys.platform are already broken, there's no reason to
>comfort them into using this defective check.
>The applications that encountered the problem (chromium, matplotlib
>and probably others) already performed the change to
>sys.platform.startswith(), so it's really the only way to go.

I still think that sys.platform for the stable releases should never report
'linux3'.  Updating the various conditionals *probably* has low risk of
regression, but I think you have to check that very carefully.

>> BTW, does anybody think sys.platform should use a more dynamic approach for
>> calculating its value?  Well, maybe not necessary if Python 3.3 will just
>> say 'linux'.
>
>There's already platform.system() for that.

TOOWTDI

----------

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


More information about the Python-bugs-list mailing list