You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
platform.system() returns incorrect value in Vista #45006
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee='https://github.com/malemburg'closed_at=<Date2007-06-12.09:27:17.000>created_at=<Date2007-05-28.01:23:43.000>labels= []
title='platform.system() returns incorrect value in Vista'updated_at=<Date2007-06-12.09:27:17.000>user='https://bugs.python.org/bleppard'
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()
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.
bleppard commented on May 30, 2007
bleppardmannequin
MannequinAuthor
More actions
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
Activity
bleppard commentedon May 28, 2007
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()
loewis commentedon May 29, 2007
Reclassifying as a patch. Marc-Andre, can you take a look? If not, please unassign.
malemburg commentedon May 29, 2007
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.
bleppard commentedon May 30, 2007
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
malemburg commentedon Jun 12, 2007
Thank you.
Committed revision 55927.