Issue4722
Created on 2008-12-22 15:06 by malicious.wizard, last changed 2010-02-05 21:41 by brian.curtin.
|
msg78190 - (view) |
Author: Alex (malicious.wizard) |
Date: 2008-12-22 15:06 |
|
== What steps will reproduce the problem?
1. Create registry key (let's assume it's located in
HKEY_CURRENT_USER\TestKey);
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
function
== 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?
|
|
msg94917 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2009-11-05 03:40 |
|
The attached patch will return "" in the case that Alex describes.
However, I haven't been able to reproduce his actions outside of
manually running the steps, so I don't have a test written for it.
Anyone know how to reproduce it from code?
|
|
msg95009 - (view) |
Author: Gabriel Genellina (gagenellina) |
Date: 2009-11-07 05:44 |
|
I cannot reproduce this bug with the current 2.6.4 release - it is
either fixed or masked now.
|
|
msg95026 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2009-11-07 20:40 |
|
It happens to me on trunk with Windows XP. I also have access to Windows
Server 2003 where I can test this (haven't yet). Which version are you
running that you don't see this issue?
|
|
msg95246 - (view) |
Author: Gabriel Genellina (gagenellina) |
Date: 2009-11-14 17:28 |
|
I've noticed this depends on the user privileges. When logged in as a
normal user, I get the internal error as originally reported. When
logged in as an administrator, there is no error and I get an empty
string.
|
|
msg98094 - (view) |
Author: Brian Curtin (brian.curtin) * |
Date: 2010-01-21 02:00 |
|
On Windows 7, I see the issue as both a regular user and one with admin privileges. The patch (updated to fix tab/space difference) seems to do the trick.
Gabriel, which OS are you on that this works differently based on the user privileges?
I'm still not sure how to test this...not sure how to modify the binary data and leave it blank via code.
|
|
| Date |
User |
Action |
Args |
| 2010-02-05 21:41:31 | brian.curtin | set | files:
- issue4722.diff |
| 2010-01-21 02:00:22 | brian.curtin | set | files:
+ issue4722.diff
messages:
+ msg98094 |
| 2010-01-21 01:51:42 | brian.curtin | set | files:
- issue4722_20091104_v1.patch |
| 2010-01-13 02:08:03 | brian.curtin | set | priority: normal keywords:
+ needs review stage: patch review versions:
- Python 2.5 |
| 2009-11-14 17:28:26 | gagenellina | set | messages:
+ msg95246 |
| 2009-11-07 20:40:07 | brian.curtin | set | messages:
+ msg95026 |
| 2009-11-07 05:44:22 | gagenellina | set | messages:
+ msg95009 |
| 2009-11-05 03:40:25 | brian.curtin | set | files:
+ issue4722_20091104_v1.patch
nosy:
+ brian.curtin messages:
+ msg94917
keywords:
+ patch |
| 2008-12-26 19:55:30 | gagenellina | set | nosy:
+ gagenellina |
| 2008-12-22 15:06:31 | malicious.wizard | create | |
|