[Patches] [ python-Patches-1620174 ] Improve platform.py usability on Windows

SourceForge.net noreply at sourceforge.net
Sun Dec 31 19:49:57 CET 2006

Patches item #1620174, was opened at 2006-12-21 15:49
Message generated for change (Comment added) made by lemburg
You can respond by visiting: 

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Luke Dunstan (infidel)
>Assigned to: M.-A. Lemburg (lemburg)
Summary: Improve platform.py usability on Windows

Initial Comment:
This patch modifies platform.py to remove most of the dependencies on pywin32, and use the standard ctypes and _winreg modules instead. It also adds support for Windows CE.


>Comment By: M.-A. Lemburg (lemburg)
Date: 2006-12-31 19:49

Logged In: YES 
Originator: NO

I haven't looked at the patch yet, so just a few general comments on
changes to platform.py:

* the code must continue to work with Python versions prior to 2.6

  This means that ctypes and _winreg support may be added as an option,
  removing pywin32 calls is not the right way to proceed.

* changes in return type of the public and documented APIs are not

  If you have a need for more information, then a new API should be
  or the information merged into one of the existing return fields.

* changes in the return values of APIs due to use of different OS APIs
  be avoided

  There's code out there relying on the return values, so if in doubt a
  API must be provided.


Comment By: Luke Dunstan (infidel)
Date: 2006-12-31 06:57

Logged In: YES 
Originator: YES

1. Yes this is intended for 2.6

2. The only difference between win32api.RegQueryValueEx and
_winreg.QueryValueEx seems to be that the latter returns Unicode strings. I
have adjusted the patch to be more compatible with the old behaviour.

3. I have updated the doc string in the new patch.

File Added: platform-wince-2.diff


Comment By: Jim Jewett (jimjjewett)
Date: 2006-12-31 01:13

Logged In: YES 
Originator: NO

( win32api.RegQueryValueEx is _winreg.QueryValueEx ) ?

If not, it should wait for 2.6, and there should be an entry in what's
new.  (I suppose similar concerns exist for other return classes.)

The change to win32_ver only half-corrects the return type to the
four-tuple.  The meaning of release (even if it is just "release name")
should be specified in the text.

 def win32_ver(release='',version='',csd='',ptype=''):
     """ Get additional version information from the Windows Registry
-        and return a tuple (version,csd,ptype) referring to version
+        and return a tuple (release,version,csd,ptype) referring to
         number, CSD level and OS type (multi/single


You can respond by visiting: 

More information about the Patches mailing list