[New-bugs-announce] [issue4722] _winreg.QueryValue fault while reading mangled registry values

Alex report at bugs.python.org
Mon Dec 22 16:06:31 CET 2008

New submission from Alex <malicious.wizard at gmail.com>:

== What steps will reproduce the problem?
1. Create registry key (let's assume it's located in
2. Walk to it in "regedit";
3. Right-click on "(Default)" and select "Modify binary data";
4. Leave everything blank and press "OK";
5. Go to Python and execute this:
>>> import _winreg
>>> _winreg.QueryValue(_winreg.HKEY_CURRENT_USER, 'TestKey')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
SystemError: ..\Objects\stringobject.c:4271: bad argument to internal

== What is the expected output? What do you see instead?
I expect either returning "''" or some ValueError indicating that source
string is malformed.

== What version of the product are you using? On what operating system?
1. Windows XP Professional SP2 English;
2. Tested on Python 2.5.2;
3. Tested on Python 2.6.1;
4. Tested on Stackless Python 2.5.2.

== Please provide any additional information below.
And yes, I know that this function is lame and everybody using it also
is lame, but it's not really a reason to include buggy functions, right?

components: Library (Lib), Windows
messages: 78190
nosy: malicious.wizard
severity: normal
status: open
title: _winreg.QueryValue fault while reading mangled registry values
type: behavior
versions: Python 2.5, Python 2.6

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list