New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
_winreg.EnumValue causes MemoryError #54146
Comments
_winreg.EnumValue causes MemoryError if the name of the value contains multibyte unicode characters. I'm using 2.6.6. |
Added sample registory data file. |
Added py file to reproduce. |
I'm not able to reproduce any MemoryError on 2.6, 2.7, or 3.2 on Windows 7 using your registry data and test script. |
I can reproduce the issue on python2.x. I cannot on |
This happens because RegQueryInfoKeyA returns maximum value http://msdn.microsoft.com/en-us/library/ms724902%28VS.85%29.aspx In multibyte environment, 2 or 3 bytes characters are I'll attach the patch to fix this issue. But be care, this is not |
Again, I'm not sure this is right fix. |
Sorry, my patch didn't pass test_dynamic_key(test_winreg). RegEnumValueA and RegQueryInfoKeyA always returned 0 for The possible fixes I can imagine are...
I'll attach the patch with option 1. |
I shall create unit test later. |
I've withdrew my patch... It has still problem, and |
Can't we use RegEnumValueW and RegQueryInfoKeyW? |
Does anyone wish to follow this up as I no longer run 2.7? |
Did anyone reproduce on python3.X? Why are versions 3.4/3.5 selected? |
In principle, winreg should not have a problem in 3.x because it only uses the UTF-16 wide-character API. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: