Erik Nolte <[EMAIL PROTECTED]> added the comment: 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 "" ---------- nosy: +enolte versions: +Python 2.4, Python 2.6 -Python 3.0 Added file: http://bugs.python.org/file11681/issue_2810.reg _______________________________________ Python tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2810> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com