Skip to content
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

Closed
bleppard mannequin opened this issue May 28, 2007 · 5 comments
Closed

platform.system() returns incorrect value in Vista #45006

bleppard mannequin opened this issue May 28, 2007 · 5 comments
Assignees

Comments

@bleppard
Copy link
Mannequin

bleppard mannequin commented May 28, 2007

BPO 1726668
Nosy @malemburg, @loewis
Files
  • Platform-VistaFix2.patch: Fix for uname() and win32_ver()
  • 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 = <Date 2007-06-12.09:27:17.000>
    created_at = <Date 2007-05-28.01:23:43.000>
    labels = []
    title = 'platform.system() returns incorrect value in Vista'
    updated_at = <Date 2007-06-12.09:27:17.000>
    user = 'https://bugs.python.org/bleppard'

    bugs.python.org fields:

    activity = <Date 2007-06-12.09:27:17.000>
    actor = 'lemburg'
    assignee = 'lemburg'
    closed = True
    closed_date = None
    closer = None
    components = ['None']
    creation = <Date 2007-05-28.01:23:43.000>
    creator = 'bleppard'
    dependencies = []
    files = ['8010']
    hgrepos = []
    issue_num = 1726668
    keywords = ['patch']
    message_count = 5.0
    messages = ['52681', '52682', '52683', '52684', '52685']
    nosy_count = 3.0
    nosy_names = ['lemburg', 'loewis', 'bleppard']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = None
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue1726668'
    versions = []

    @bleppard
    Copy link
    Mannequin Author

    bleppard mannequin commented 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()

    @bleppard bleppard mannequin closed this as completed May 28, 2007
    @bleppard bleppard mannequin assigned malemburg May 28, 2007
    @loewis
    Copy link
    Mannequin

    loewis mannequin commented May 29, 2007

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

    @malemburg
    Copy link
    Member

    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
    Copy link
    Mannequin Author

    bleppard mannequin commented 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
    Copy link
    Member

    Thank you.

    Committed revision 55927.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    None yet
    Projects
    None yet
    Development

    No branches or pull requests

    1 participant