New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
platform.system() returns incorrect value in Vista #45006
Comments
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() |
Reclassifying as a patch. Marc-Andre, can you take a look? If not, please unassign. |
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. |
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. |
Thank you. Committed revision 55927. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: