This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Improve platform.py usability on Windows
Type: Stage:
Components: Library (Lib) Versions: Python 2.6
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: lemburg Nosy List: infidel, jimjjewett, lemburg
Priority: normal Keywords: patch

Created on 2006-12-21 14:49 by infidel, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
platform-wince.diff infidel, 2006-12-21 14:49
platform-wince-2.diff infidel, 2006-12-31 05:57 Updated patch
Messages (8)
msg51592 - (view) Author: Luke Dunstan (infidel) Date: 2006-12-21 14:49
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.
msg51593 - (view) Author: Jim Jewett (jimjjewett) Date: 2006-12-31 00:13

( 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 version
         number, CSD level and OS type (multi/single
         processor).

msg51594 - (view) Author: Luke Dunstan (infidel) Date: 2006-12-31 05:57
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
msg51595 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2006-12-31 18:49
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, but 
  removing pywin32 calls is not the right way to proceed.

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

  If you have a need for more information, then a new API should be added,
  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 must
  be avoided

  There's code out there relying on the return values, so if in doubt a new
  API must be provided.
msg51596 - (view) Author: Luke Dunstan (infidel) Date: 2007-01-01 06:25
Why does platform.py need to be compatible with earlier versions of Python?

The return types haven't changed, and I think the return values won't change because the same OS APIs are being used.
msg51597 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2007-01-13 23:21
platform.py is used outside the Python distribution to check which Python version is being used (among other things).

It has to run with Python versions as early as 1.5.2.

That said, it's OK to have it use different ways of accessing the needed information, provided that the signatures and return values of the public APIs don't change.
msg51598 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2007-06-12 09:33
Please update the patch to:

 * not change the APIs of public interfaces

 * support both the win32 extension and the combination _winreg and ctypes

 * work on all Python versions since Python 1.5.2

Otherwise, I'll have to reject the patch.

Thanks.
msg57782 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2007-11-23 09:55
Rejecting the patch, since it hasn't been updated.
History
Date User Action Args
2022-04-11 14:56:21adminsetgithub: 44371
2007-11-23 09:55:59lemburgsetstatus: open -> closed
resolution: rejected
messages: + msg57782
2007-11-23 09:17:45christian.heimessetcomponents: + Library (Lib), - None
versions: + Python 2.6
2006-12-21 14:49:51infidelcreate