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.

Author enolte
Recipients enolte, loewis, stutzbach
Date 2008-10-02.17:20:26
SpamBayes Score 1.0162596e-07
Marked as misclassified No
Message-id <1222968027.92.0.0396872077741.issue2810@psf.upfronthosting.co.za>
In-reply-to
Content
To reproduce on Windows XP with Python 2.4, 2.5, and 2.6:

1. Import issue_2810.reg (it creates two keys under
HKCU\PythonTestUnicodeKeys: one with a one byte unicode char in the key,
the other with multiple 2-byte unicode chars)

2. Run the following:
import _winreg

key = _winreg.OpenKey( _winreg.HKEY_CURRENT_USER, "PythonTestUnicodeKeys" )

one_byte_key = _winreg.EnumKey( key, 0 )
two_byte_key = _winreg.EnumKey( key, 1 )

_winreg.CloseKey( key )

try:
    unicode( one_byte_key )
except Exception, ex:
    print "EnumKey didn't return a valid string:", ex
    
print "should be unicode, not str:", two_byte_key.__class__
for ch in two_byte_key:
    print ord( ch ),
print ""
History
Date User Action Args
2008-10-02 17:20:28enoltesetrecipients: + enolte, loewis, stutzbach
2008-10-02 17:20:27enoltesetmessageid: <1222968027.92.0.0396872077741.issue2810@psf.upfronthosting.co.za>
2008-10-02 17:20:27enoltelinkissue2810 messages
2008-10-02 17:20:26enoltecreate