Ronald Oussoren <ronaldousso...@mac.com> added the comment:
IMHO SystemError is the wrong exception, that exception is primarily used to signal implementation errors. BTW. I can reproduce crashes in a couple of runs of your scriptlet: Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 26 2018, 23:26:24) [Clang 6.0 (clang-600.0.57)] on darwin Type "help", "copyright", "credits" or "license" for more information. >>> from _struct import Struct >>> for i in range(100000): ... L = [Struct.__new__(Struct) for j in range(1000)] ... for s in L: ... try: ... x = s.pack_into(bytearray()) ... except SystemError: ... pass ... Traceback (most recent call last): File "<stdin>", line 5, in <module> TypeError: 'code' object cannot be interpreted as an integer >>> >>> from _struct import Struct >>> for i in range(100000): ... L = [Struct.__new__(Struct) for j in range(1000)] ... for s in L: ... try: ... x = s.pack_into(bytearray()) ... except SystemError: ... pass ... Traceback (most recent call last): File "<stdin>", line 5, in <module> TypeError: 'traceback' object cannot be interpreted as an integer >>> >>> >>> >>> from _struct import Struct >>> for i in range(100000): ... L = [Struct.__new__(Struct) for j in range(1000)] ... for s in L: ... try: ... x = s.pack_into(bytearray()) ... except SystemError: ... pass ... Segmentation fault: 11 ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue34543> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com