New submission from Trent Nelson <[EMAIL PROTECTED]>: test_getargs2 fails on Win x64:
test_getargs2 is failing on Windows x64: test test_getargs2 failed -- Traceback (most recent call last): File "S:\buildbots\python.x64\3.0.nelson-win64\build\lib\test\test_getargs2.py", line 190, in test_n self.failUnlessEqual(99, getargs_n(Long())) TypeError: 'Long' object cannot be interpreted as an integer The problem is twofold: case 'n' on Win x64 (where SIZEOF_SIZE_T != SIZEOF_LONG) had a broken code path and needed updating. Also, the fallback to 'l' for systems where SIZEOF_SIZE_T == SIZEOF_LONG wasn't correct -- it should still do a PyNumber_Index() check, and then use PyLong_AsSize_t() to extract the value. The attached patch corrects the behaviour on 32-bit and 64-bit systems, including Windows. However, it has now uncovered another bug in Windows x64: >>> from _testcapi import getargs_n >>> getargs_n(sys.maxsize) 9223372036854775807 >>> getargs_n(-sys.maxsize) 1 >>> getargs_n(-sys.maxsize-1) 0 After a bit of investigation with Martin, the logic in PyLong_AsSize_t() is incorrect and needs to be reworked to handle negative maximums properly. ---------- components: Interpreter Core files: getargs_and_abstract.patch keywords: patch, patch messages: 64212 nosy: Trent.Nelson, loewis severity: normal status: open title: Issues with getargs_n(), PyNumber_Index and PyLong_AsSize_t. versions: Python 3.0 Added file: http://bugs.python.org/file9793/getargs_and_abstract.patch __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue2440> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com