-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
Closed
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
In Python 3.8:
Python 3.8.12 (default, Oct 4 2021, 15:56:52) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import _struct >>> _struct.Struct.x = 1 Traceback (most recent call last): File "<stdin>", line 1, in <module> TypeError: can't set attributes of built-in/extension type 'Struct' >>> On main:
Python 3.12.0a0 (heads/gh-94207-fix-struct-module-leak:9d41baebd0, Jun 25 2022, 07:23:49) [GCC 9.4.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> import _struct >>> _struct.Struct.x=1 >>> _struct.Struct.x 1This happens because _struct.Struct is missing Py_TPFLAGS_IMMUTABLETYPE in type flags.
erlend-aasland
Metadata
Metadata
Assignees
Labels
extension-modulesC modules in the Modules dirC modules in the Modules dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error