cpython: b9752b6c40f8 (original) (raw)

Mercurial > cpython

changeset 81083:b9752b6c40f8 3.2

Fix #14420. Use PyLong_AsUnsignedLong to support the full range of DWORD. This fixes an OverflowError seen in winreg.SetValueEx when passed winreg.REG_DWORD values that should be supported by the underlying API. [#14420]

Brian Curtin brian@python.org
date Thu, 27 Dec 2012 10:12:45 -0600
parents 62f67a52b0c2
children 94a76b49dc69 cd2b4074a2d9 4b7e60e05027
files Lib/test/test_winreg.py Misc/NEWS PC/winreg.c
diffstat 3 files changed, 16 insertions(+), 1 deletions(-)[+] [-] Lib/test/test_winreg.py 12 Misc/NEWS 3 PC/winreg.c 2

line wrap: on

line diff

--- a/Lib/test/test_winreg.py +++ b/Lib/test/test_winreg.py @@ -323,6 +323,18 @@ class LocalWinregTests(BaseWinregTests): finally: DeleteKey(HKEY_CURRENT_USER, test_key_name)

+ @unittest.skipUnless(REMOTE_NAME, "Skipping remote registry tests") class RemoteWinregTests(BaseWinregTests):

--- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.2.4 Core and Builtins ----------------- +- Issue #14420: Support the full DWORD (unsigned long) range in Py2Reg

--- a/PC/winreg.c +++ b/PC/winreg.c @@ -785,7 +785,7 @@ Py2Reg(PyObject *value, DWORD typ, BYTE memcpy(*retDataBuf, &zero, sizeof(DWORD)); } else {