This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author eryksun
Recipients Dave Jones, eryksun, ncoghlan, serhiy.storchaka
Date 2017-01-13.23:53:52
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1484351632.83.0.957451441914.issue29270@psf.upfronthosting.co.za>
In-reply-to
Content
In 3.6, type_new in Objects/typeobject.c sets the __classcell__ in the dict if it's a cell object. It happens that CreateSwappedType in Modules/_ctypes/_ctypes.c re-uses the dict to create the swapped type (e.g. big endian), which in turn updates the __classcell__. Thus in builtin___build_class__ in Python/bltinmodule.c, the check `cell_cls != cls` ends up being true, which leads to the observed TypeError. CreateSwappedType should be able to avoid this by either deleting "__classcell__" from the dict or creating a copy without it before passing it to type_new.
History
Date User Action Args
2017-01-13 23:53:52eryksunsetrecipients: + eryksun, ncoghlan, serhiy.storchaka, Dave Jones
2017-01-13 23:53:52eryksunsetmessageid: <1484351632.83.0.957451441914.issue29270@psf.upfronthosting.co.za>
2017-01-13 23:53:52eryksunlinkissue29270 messages
2017-01-13 23:53:52eryksuncreate