Message66542
_winreg.EnumValue raises a WindowsError ("More data is available") if
the registry data includes multibyte unicode characters.
Inspecting PyEnumValue in _winreg.c, I believe I see the problem. The
function uses RegQueryInfoKey to determine the maximum data and key name
sizes to pass to RegEnumValue.
Unfortunately, RegQueryInfoKey returns the size in number of unicode
characters, while RegEnumValue expects a size in bytes. This is OK if
all the values are ASCII, but it fails if there are any multibyte
unicode characters.
I believe it would be sufficient to multiply the sizes by 4, since
that's the maximum width of a unicode character.
The bug exists in at least Python 2.5 and Python 3.0 (based on source
code inspection).
References:
RegEnumValue: http://msdn.microsoft.com/en-us/library/ms724865(VS.85).aspx
RegQueryInfoKey:
http://msdn.microsoft.com/en-us/library/ms724902(VS.85).aspx |
|
| Date |
User |
Action |
Args |
| 2008-05-10 17:37:35 | stutzbach | set | spambayes_score: 0.00301564 -> 0.00301564 recipients:
+ stutzbach |
| 2008-05-10 17:37:34 | stutzbach | set | spambayes_score: 0.00301564 -> 0.00301564 messageid: <1210441054.55.0.264831714691.issue2810@psf.upfronthosting.co.za> |
| 2008-05-10 17:37:32 | stutzbach | link | issue2810 messages |
| 2008-05-10 17:37:31 | stutzbach | create | |
|