[Patches] [ python-Patches-554807 ] Add _winreg support for Cygwin

noreply@sourceforge.net noreply@sourceforge.net
Sun, 28 Jul 2002 03:02:44 -0700


Patches item #554807, was opened at 2002-05-11 14:01
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=554807&group_id=5470

Category: Windows
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Gerald S. Williams (gsw_agere)
Assigned to: Nobody/Anonymous (nobody)
Summary: Add _winreg support for Cygwin

Initial Comment:
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.

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

>Comment By: Martin v. Löwis (loewis)
Date: 2002-07-28 12:02

Message:
Logged In: YES 
user_id=21627

Is any kind of tweaking forthcoming?

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

Comment By: Gerald S. Williams (gsw_agere)
Date: 2002-05-15 15:30

Message:
Logged In: YES 
user_id=329402

It sounds like the patches need some tweaking (my testing 
had passed but was certainly limited).

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-05-15 14:57

Message:
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.

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

Comment By: Gerald S. Williams (gsw_agere)
Date: 2002-05-15 14:48

Message:
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.

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

Comment By: Martin v. Löwis (loewis)
Date: 2002-05-15 00:23

Message:
Logged In: YES 
user_id=21627

Can you please explain why not using MBCS is the right thing?

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

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