Thomas Heller added the comment: Ok, added the missing Py_DECREF, changed to TypeError, and added a test. Added file: http://bugs.python.org/file9178/ctypes-struct.patch __________________________________ Tracker <report at bugs.python.org> <http://bugs.python.org/issue1831> __________________________________