This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author p.lavarre@ieee.org
Recipients jafo, janssen, lemburg, p.lavarre@ieee.org
Date 2007-09-17.17:57:21
SpamBayes Score 0.0006376505
Marked as misclassified No
Message-id <1190051842.2.0.31120144199.issue1082@psf.upfronthosting.co.za>
In-reply-to
Content
I recommend we reject this first draft of the python-trunk-
vistaplatform.patch.

I reason as follows ...

ACTUAL RESULTS OF 2.5.1 PLUS PATCH IN VISTA WINDOWS:

>>> import platform
>>> ...
>>> platform.uname()
('Microsoft', '[redacted]', 'Windows', '6.0.6000', '', '')
>>> platform.system()
'Windows'
>>> platform.release()
'Windows'
>>>

EXPECTED RESULTS OF 2.5.1 PLUS PATCH IN VISTA WINDOWS:

>>> import platform
>>> ...
>>> platform.uname()
('Windows', '[redacted]', 'Vista', '6.0.6000', '', '')
>>> platform.system()
'Windows'
>>> platform.release()
'Vista'
>>>

ACTUAL RESULTS OF 2.5 IN SP2 XP WINDOWS:

>>> import platform
>>> ...
>>> platform.uname()
('Windows', '[redacted]', 'XP', '5.1.2600', '', '')
>>> platform.system()
'Windows'
>>> platform.release()
'XP'
>>>

DISCUSSION:

Four thoughts:

1.

I think we meant to write { unameInfo[2] == 'Windows' } where we wrote 
{ unameInfo == 'Windows' } in this patch.

2.

To run the patch I created a copy of platform.py in the same folder and 
applied the patch by hand. I redacted the host names by hand and elided 
the { platform = ... } source line I wrote to let me run the patch in 
place of the original.

3.

I think we should substitute a different kind of patch, a patch to 
correct the platform.uname rather than a patch to redefine 
platform.system and platform.version.

I'd like us to hold to such cross-platform invariants as:

( platform.system() == platform.uname()[0] )

( platform.system() == platform.uname()[2] )

Out on the web I see that we have documented these invariants. I quote:

""" 14.12.1 Cross Platform 
 
uname()

... Returns a tuple of strings (system, node, release, version, 
machine, processor) identifying the underlying platform. 

""" 2007-09-17 fetch of http://docs.python.org/lib/node442.html
""" near http://docs.python.org/lib/module-platform.html

4.

I don't think we can totally fix this trouble in code: we have 
distributed 2.5.1 to Vista too massively already now.

Specifically, I think we should also fix the doc to admit the hereafter 
frequent need for people using Python to write code such as:

if not (platform.system() in ('Microsoft', 'Windows')):
History
Date User Action Args
2007-09-17 17:57:22p.lavarre@ieee.orgsetspambayes_score: 0.00063765 -> 0.0006376505
recipients: + p.lavarre@ieee.org, lemburg, jafo, janssen
2007-09-17 17:57:22p.lavarre@ieee.orgsetspambayes_score: 0.00063765 -> 0.00063765
messageid: <1190051842.2.0.31120144199.issue1082@psf.upfronthosting.co.za>
2007-09-17 17:57:22p.lavarre@ieee.orglinkissue1082 messages
2007-09-17 17:57:21p.lavarre@ieee.orgcreate