classification
Title: winreg SetValueEx DWord type incompatible with value argument
Type: behavior Stage: resolved
Components: Extension Modules, Windows Versions: Python 3.4, Python 3.2, Python 3.3
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: brian.curtin Nosy List: RoSanford, brian.curtin, python-dev, tim.golden
Priority: normal Keywords: needs review, patch

Created on 2012-03-26 22:22 by RoSanford, last changed 2012-12-27 18:30 by brian.curtin. This issue is now closed.

Files
File name Uploaded Description Edit
issue14420_part1.diff brian.curtin, 2012-12-24 00:14 review
Messages (8)
msg156875 - (view) Author: Bob (RoSanford) Date: 2012-03-26 22:22
When calling winreg.SetValueEx(key, value_name, reserved, type, value), the value argument does not support the full range of a 32 bit unsigned integer, which the Window's registry API is expecting. For example, passing a value 0x80000000 will result in the following exception:
OverflowError: Python int too large to convert to C long. For consistency with the Window's binding, it should support an unsigned long.
msg156898 - (view) Author: Tim Golden (tim.golden) * (Python committer) Date: 2012-03-27 08:18
Brian - I think this is your area
msg156935 - (view) Author: Bob (RoSanford) Date: 2012-03-27 15:27
Likewise, the winreg.QueryValueEx method returns a signed 32 bit value, instead of a 32 bit unsigned value.
msg178022 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2012-12-24 00:14
Here is a patch for the first part (SetValueEx).
msg178302 - (view) Author: Roundup Robot (python-dev) Date: 2012-12-27 16:30
New changeset b9752b6c40f8 by Brian Curtin in branch '3.2':
Fix #14420. Use PyLong_AsUnsignedLong to support the full range of DWORD.
http://hg.python.org/cpython/rev/b9752b6c40f8
msg178303 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2012-12-27 16:33
This is fixed on 3.2 through 3.4. On 2.7 we get a ValueError trying to do the same thing so I'll create a separate issue for that since it involves fixing more than just the change in Py2Reg.
msg178306 - (view) Author: Roundup Robot (python-dev) Date: 2012-12-27 18:29
New changeset ccbb16719540 by Brian Curtin in branch '2.7':
Fix #14420. Check for PyLong as well as PyInt when converting in Py2Reg.
http://hg.python.org/cpython/rev/ccbb16719540
msg178307 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2012-12-27 18:30
Never mind msg178303. The fix was roughly the same and in the same area, so now we're covered on 2.7 as well.
History
Date User Action Args
2012-12-27 18:30:35brian.curtinsetmessages: + msg178307
2012-12-27 18:29:20python-devsetmessages: + msg178306
2012-12-27 16:33:12brian.curtinsetstatus: open -> closed
versions: + Python 3.3, Python 3.4
messages: + msg178303

resolution: fixed
stage: patch review -> resolved
2012-12-27 16:30:57python-devsetnosy: + python-dev
messages: + msg178302
2012-12-24 00:33:58brian.curtinlinkissue16759 dependencies
2012-12-24 00:14:19brian.curtinsetkeywords: + needs review, patch
files: + issue14420_part1.diff
messages: + msg178022

stage: needs patch -> patch review
2012-03-27 15:27:29RoSanfordsetmessages: + msg156935
2012-03-27 13:05:48brian.curtinsetassignee: brian.curtin
components: + Extension Modules
stage: needs patch
2012-03-27 08:18:22tim.goldensetnosy: + tim.golden, brian.curtin
messages: + msg156898
2012-03-26 22:22:16RoSanfordcreate