[issue31311] SystemError raised by PyCData_setstate() in case __dict__ is not a dict

2017-08-30 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: And the following example results in segmentation fault. import ctypes class BadStruct(ctypes.Structure): @property def __dict__(self): raise AttributeError BadStruct().__setstate__({}, b'') As for change the format given to PyArg_ParseTuple(

[issue31311] SystemError raised by PyCData_setstate() in case __dict__ is not a dict

2017-08-30 Thread Oren Milman
Oren Milman added the comment: typo - change the format to "O!s#" -- ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscr

[issue31311] SystemError raised by PyCData_setstate() in case __dict__ is not a dict

2017-08-30 Thread Oren Milman
New submission from Oren Milman: The following code causes PyCData_setstate() (in Modules/_ctypes/_ctypes.c) to raise a SystemError: import ctypes class BadStruct(ctypes.Structure): def __dict__(self): pass BadStruct().__setstate__({}, b'foo') this is because PyCData_setstate() ass