Message55972
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')): |
|
Date |
User |
Action |
Args |
2007-09-17 17:57:22 | p.lavarre@ieee.org | set | spambayes_score: 0.00063765 -> 0.00063765 recipients:
+ p.lavarre@ieee.org, lemburg, jafo, janssen |
2007-09-17 17:57:22 | p.lavarre@ieee.org | set | spambayes_score: 0.00063765 -> 0.00063765 messageid: <1190051842.2.0.31120144199.issue1082@psf.upfronthosting.co.za> |
2007-09-17 17:57:22 | p.lavarre@ieee.org | link | issue1082 messages |
2007-09-17 17:57:21 | p.lavarre@ieee.org | create | |
|