[ python-Bugs-945665 ] platform.system() Windows inconsistency

SourceForge.net noreply at sourceforge.net
Sat Jun 5 10:07:47 EDT 2004


Bugs item #945665, was opened at 2004-05-01 01:19
Message generated for change (Comment added) made by jlgijsbers
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=945665&group_id=5470

Category: Python Library
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Guido van Rossum (gvanrossum)
Assigned to: Nobody/Anonymous (nobody)
Summary: platform.system() Windows inconsistency

Initial Comment:
On Windows, platform.system() (and platform.uname()
[0]) return 'Windows' or 'Microsoft Windows' depending 
on whether win32api is available or not. This is 
confusing and can lead to hard-to-find bugs where 
testing in one environment doesn't reveal a bug that 
only occurs in another environment.

I believe this hasn't been fixed in Python 2.4 yet  (only 
the XP recognition has been fixed, it is also broken in 
2.3 when win32api was available).

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

Comment By: Johannes Gijsbers (jlgijsbers)
Date: 2004-06-05 16:07

Message:
Logged In: YES 
user_id=469548

Yep, _syscmd_ver() returns 'Microsoft Windows' while the
default is 'Windows'. Setting the default to Microsoft
Windows seems the easiest way here (putting patch inline
because I can't attach it):

Index: platform.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/platform.py,v
retrieving revision 1.13
diff -u -r1.13 platform.py
--- platform.py	4 May 2004 18:18:59 -0000	1.13
+++ platform.py	5 Jun 2004 13:07:45 -0000
@@ -966,7 +966,7 @@
                     version = '32bit'
                 else:
                     version = '16bit'
-            system = 'Windows'
+            system = 'Microsoft Windows'
 
         elif system[:4] == 'java':
             release,vendor,vminfo,osinfo = java_ver()

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=945665&group_id=5470



More information about the Python-bugs-list mailing list