[issue8014] Setting a T_INT attribute raises internal error

2010-04-06 Thread Mark Dickinson
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 ___

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
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 ___

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
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.

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
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

[issue8014] Setting a T_INT attribute raises internal error

2010-03-13 Thread Mark Dickinson
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.

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Walter Dörwald
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,

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Benjamin Peterson
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:

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Mark Dickinson
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

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Mark Dickinson
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

[issue8014] Setting a T_INT attribute raises internal error

2010-02-24 Thread Benjamin Peterson
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