[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Backported to 3.1 in r79838. -- resolution: - fixed status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Thanks, Benjamin! test_structmembers.py looks perfect. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Tests for this issue, currently failing on T_INT/T_UINT (internal error), T_LONG/T_ULONG (fails to raise TypeError), T_PYSSIZET (internal error). The older patch only fixes the T_PYSSIZET failures; I'm working on a fix for the others. -- Added file: http://bugs.python.org/file16532/issue8014_tests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Internal errors for T_UINT and T_PYSSIZET fixed in r78918. The fix needs to be backported to the release31-maint branch, but I don't think it's urgent enough to try getting it in between 3.1.2 rc1 and 3.1.2 final. There's still a problem with testing repeated attribute setting for T_UINT and T_ULONG; for some reason, the first attempt to set a T_UINT attribute to something invalid correctly produces TypeError, but an immediately following second attempt doesn't raise TypeError---this can be seen by uncommenting the T_UINT and T_ULONG bits in test_bad_assignments. Am investigating. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Fixed reason for failing tests (there was a bad error check in structmembers.c that compared a return value with (unsigned int)-1 instead of (unsigned long)-1), and re-enabled those tests, in r78920. Leaving open for the backport to 3.1. -- versions: -Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
New submission from Walter Dörwald wal...@livinglogic.de: In the current py3k branch setting an attribute of an object with PyMemberDefs raises an internal error: $ ./python.exe Python 3.2a0 (py3k:78419M, Feb 24 2010, 17:56:06) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. x = UnicodeEncodeError('ascii', 'gurk', 0, 4, 'broken') [37539 refs] x.start = None Traceback (most recent call last): File stdin, line 1, in module SystemError: Objects/longobject.c:439: bad argument to internal function In Python 2.6.4 (and in the current trunk version) this raises a proper TypeError: $ python Python 2.6.4 (r264:75706, Oct 27 2009, 15:18:04) [GCC 4.2.1 (Apple Inc. build 5646)] on darwin Type help, copyright, credits or license for more information. x = UnicodeEncodeError('ascii', u'gurk', 0, 4, 'broken') x.start = None Traceback (most recent call last): File stdin, line 1, in module TypeError: an integer is required -- messages: 100051 nosy: doerwalter severity: normal status: open title: Setting a T_INT attribute raises internal error type: behavior versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Benjamin Peterson benja...@python.org added the comment: It seems that T_INT uses PyLong_AsLong to get a integer, and 2.x uses PyInt_AsLong. PyInt_AsLong tries to convert the number to an integer, but PyLong_AsLong just throws up if the type is not correct. Mark, thoughts? -- nosy: +benjamin.peterson, mark.dickinson ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Might it be T_PYSSIZET rather than T_INT? In which case it's PyLong_AsSsize_t that's at fault: it should raise TypeError for non-integers. What's slightly less clear is whether PyLong_AsSsize_t should also try to call int to convert to int, as PyLong_AsLong does; I'd say not---the PyLong_AsLong behaviour isn't particularly desirable in my view, and is mostly there for historical reasons. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Mark Dickinson dicki...@gmail.com added the comment: Here's a patch that raises TypeError if either PyLongAs_Size_t or PyLong_As_Ssize_t gets called with a valid non-integer PyObject *. I'm not sure where the most appropriate place for a test is. -- assignee: - mark.dickinson keywords: +patch priority: - normal stage: - test needed Added file: http://bugs.python.org/file16363/issue8014.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8014] Setting a T_INT attribute raises internal error
Benjamin Peterson benja...@python.org added the comment: 2010/2/24 Mark Dickinson rep...@bugs.python.org: Mark Dickinson dicki...@gmail.com added the comment: Here's a patch that raises TypeError if either PyLongAs_Size_t or PyLong_As_Ssize_t gets called with a valid non-integer PyObject *. I'm not sure where the most appropriate place for a test is. There's test_structmembers.py I think. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8014 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com