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 dino.viehland
Recipients dino.viehland, eric.snow, vstinner
Date 2019-05-21.21:31:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1558474270.84.0.958874839775.issue37002@roundup.psfhosted.org>
In-reply-to
Content
This is another catch of using PyType_FromSpec (similar to  https://bugs.python.org/issue26979 but also completely different).

Because PyType_FromSpec produces a heap type it gets the Py_TPFLAGS_HEAPTYPE flag set on the newly produced type.  To enforce the immutability of built-in types type_setattro checks this flag.  Therefore these types end up being mutable, e.g:

import _ssl
_ssl.SSLError.x = 42

In addition to not providing parity for replacing PyType_Ready in the stable API, it also means that this could presumably bleed across sub-interpreters or just provide surprising and bad results.
History
Date User Action Args
2019-05-21 21:31:10dino.viehlandsetrecipients: + dino.viehland, vstinner, eric.snow
2019-05-21 21:31:10dino.viehlandsetmessageid: <1558474270.84.0.958874839775.issue37002@roundup.psfhosted.org>
2019-05-21 21:31:10dino.viehlandlinkissue37002 messages
2019-05-21 21:31:10dino.viehlandcreate