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

SourceForge.net noreply at sourceforge.net
Wed May 30 08:04:25 CEST 2007


Patches item #1726668, was opened at 2007-05-27 21:23
Message generated for change (Comment added) made by bleppard
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: Benjamin Leppard (bleppard)
Date: 2007-05-30 02:04

Message:
Logged In: YES 
user_id=1802829
Originator: YES

I updated the patch to included comments, and set the release to 'Vista'
when the version starts with '6.0'. Unfortunately both Windows Server 2008
and Windows Vista both are version 6.0.

I updated win32_ver() to report the correct values for Vista and Windows
Server 2008. It reports release of '2008Server' for Windows 2008 server,
and release of 'post2008Server' for version 6.1 or greater. I have not
tested it under Windows Server 2008.
File Added: Platform-VistaFix2.patch

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

Comment By: M.-A. Lemburg (lemburg)
Date: 2007-05-29 12: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 01: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


More information about the Patches mailing list