<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=ISO-8859-1">
</head>
<body text="#000000" bgcolor="#FFFFFF">
Hello,<br>
<br>
if I call platform.win32_ver() with ipy 2.7.4 I get the following
exception:<br>
<br>
IronPython 2.7.4 (2.7.0.40) on .NET 4.0.30319.1008 (32-bit)<br>
Type "help", "copyright", "credits" or "license" for more
information.<br>
>>> import platform<br>
>>> x = platform.win32_ver()<br>
Traceback (most recent call last):<br>
File "<stdin>", line 1, in <module><br>
File "C:\Program Files (x86)\IronPython 2.7\Lib\platform.py", line
615, in win32_ver<br>
AttributeError: 'sys.getwindowsversion' object has no attribute
'service_pack_major'<br>
<br>
Line 615 is the underlined text in the program snippet from
platform.py below:<br>
<br>
# Find out the registry key and some general version infos<br>
winver = GetVersionEx()<br>
maj,min,buildno,plat,csd = winver<br>
version = '%i.%i.%i' % (maj,min,buildno & 0xFFFF)<br>
if hasattr(winver, "service_pack"):<br>
if winver.service_pack != "":<br>
<u>csd = 'SP%s' % winver.service_pack_major</u><br>
else:<br>
if csd[:13] == 'Service Pack ':<br>
csd = 'SP' + csd[13:]<br>
<br>
In the previous version I used (2.7.1) this error did not occur. It
looks that the underlying implementations of sys.getwindowsversion()
in 2.7.1 and 2.7.4 have a different behaviour:<br>
<br>
- in 2.7.1 the function returns a tuple<br>
- in 2.7.4 an object is delivered which has the attribute
"service_pack" but not "service_pack_major"<br>
<br>
Greeting and thank you in advance<br>
Peter Schwalm<br>
<br>
<br>
</body>
</html>