[ python-Patches-1726668 ] platform.system() returns incorrect value in Vista

"SourceForge.net" <[email protected]>
Newsgroups gmane.comp.python.patches
Message-ID <[email protected]>
Patches item #1726668, was opened at 2007-05-28 03:23
Message generated for change (Comment added) made by lemburg
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1726668&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Benjamin Leppard (bleppard)
Assigned to: M.-A. Lemburg (lemburg)
Summary: platform.system() returns incorrect value in Vista

Initial Comment:


On Microsoft Vista platform.system() returns 'Microsoft' and platform.release() returns 'Windows'

Under Microsoft Windows XP SP2 platform.system() returns 'Windows' and platform.release() returns 'XP'.

This is problem was caused by a change in the output of the "ver" command. In Windows XP SP2 "ver" outputted 'Microsoft Windows XP [Version 5.1.2600]'  In Microsoft Vista "ver" outputted 'Microsoft Windows [Version 6.0.6000]'. The lack of the 3rd word before version causes _syscmd_ver(...) in platform.py to return 'Microsoft' for system instead of 'Microsoft Windows'. This causes uname() to return the incorrect values. Both system() and release() call uname().

This problem occurs in the trunk.

I have attached a patch against the trunk svn that fixes the symptom of the problem in uname()

----------------------------------------------------------------------

>Comment By: M.-A. Lemburg (lemburg)
Date: 2007-05-29 18:08

Message:
Logged In: YES 
user_id=38388
Originator: NO

I don't have Vista handy to check the patch. 

Ideally, win32_ver() should be patched to return proper values for Vista
directly from the registry. Would be great if you could provide a patch for
this as well.

However, in some cases _syscmd_ver() will still be used, so the patch is
fine. Please add a comment explaining the problem and also add a check to
set release to 'Vista' in case the version starts with '6.0'.

Thanks.

----------------------------------------------------------------------

Comment By: Martin v. Löwis (loewis)
Date: 2007-05-29 07:11

Message:
Logged In: YES 
user_id=21627
Originator: NO

Reclassifying as a patch. Marc-Andre, can you take a look? If not, please
unassign.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=1726668&group_id=5470
_______________________________________________
Patches mailing list
[email protected]
http://mail.python.org/mailman/listinfo/patches
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.