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: Add _winreg support for Cygwin
Type: Stage:
Components: Windows Versions: Python 2.3
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: mhammond Nosy List: gsw_agere, loewis, mhammond, nobody
Priority: normal Keywords: patch

Created on 2002-05-11 12:01 by gsw_agere, last changed 2022-04-10 16:05 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
_winreg.c.patch gsw_agere, 2002-05-11 12:01 _winreg.c changes
setup.py.patch gsw_agere, 2002-05-11 12:02 setup.py changes
Messages (11)
msg39986 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-05-11 12:01
This adds _winreg support to Cygwin Python without 
dependencies on other Windows modules.

For platforms in which MS_WINDOWS isn't defined, this 
reports the OSError exception instead of WindowsErr. 
It also uses the non-MBCS versions of registry access 
in this case.

Some minor changes to _winreg.c were made to clean up 
compiler warnings from GCC.

setup.py was changed to create a dynamic _winreg 
module under cygwin. There are also some earlier 
changes in the patch file to skip the import test (due 
to Cygwin fork issues), and to require libintl when 
building _locale under Cygwin.
msg39987 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-05-14 22:23
Logged In: YES 
user_id=21627

Can you please explain why not using MBCS is the right thing?
msg39988 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-05-15 12:48
Logged In: YES 
user_id=329402

Windows supplies two versions of the relevant functions. 
The Cygwin version (at least as built) uses the ANSI 
versions, as indicated by the A at the end of the symbol 
names:
  $ nm _winreg.o | grep RegQueryValue
           U _RegQueryValueA@16
           U _RegQueryValueExA@24

As opposed to the "Windows Unicode/wide-char" functions, 
which end in W and require MBCS functions to decode.
msg39989 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-05-15 12:57
Logged In: YES 
user_id=21627

Yes, but you are wrong assuming that the *A functions expect
Latin-1. Instead, they expect char* encoded as CP_ACP, which
is known as "mbcs" in Python.

The *W functions do *not* expect multi-byte strings, but
Unicode strings.

Notice that _winreg also calls the *A functions, even in
MSVC builds.

So I think converting Unicode to Latin-1 is definitely
incorrect.
msg39990 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-05-15 13:30
Logged In: YES 
user_id=329402

It sounds like the patches need some tweaking (my testing 
had passed but was certainly limited).
msg39991 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-07-28 10:02
Logged In: YES 
user_id=21627

Is any kind of tweaking forthcoming?
msg39992 - (view) Author: Gerald S. Williams (gsw_agere) Date: 2002-07-30 14:04
Logged In: YES 
user_id=329402

I plan to get back to this eventually, although held off for three 
reasons:
 - Cygwin is incorporating a registry file system that may be a 
better way to implement this
 - saw some posts about possible Unicode changes
 - Real Life (job priorities, vacation)

I probably won't get back to this until the middle of August.
msg39993 - (view) Author: Nobody/Anonymous (nobody) Date: 2002-09-16 17:19
Logged In: NO 

I'm prepared to try to help if there's still energy here, and there
are specific things to do.

However I agree that _if_ the cygwin /proc/registry story is
going to become writeable, then there's not much point.
msg39994 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2002-09-16 17:57
Logged In: YES 
user_id=21627

If a convincing patch comes along, I'd happily apply it.
Supporting _winreg is still reasonable even if
/proc/registry exists, for compatibility with other Win32 ports.
msg39995 - (view) Author: Mark Hammond (mhammond) * (Python committer) Date: 2002-09-18 02:57
Logged In: YES 
user_id=14198

I'll take this on.  I have a number of other patches and
bugs to look at, so if someone wants to beat me to it, be my
guest.
msg39996 - (view) Author: Martin v. Löwis (loewis) * (Python committer) Date: 2003-03-28 23:31
Logged In: YES 
user_id=21627

I'm rejecting that patch, since no updates are happening. If
somebody wants to deal with _winreg support for Cygwin
again, please submit a new patch.
History
Date User Action Args
2022-04-10 16:05:18adminsetgithub: 36589
2002-05-11 12:01:41gsw_agerecreate