[New-bugs-announce] [issue13204] sys.flags.__new__ crashes

Andreas Stührk report at bugs.python.org
Tue Oct 18 00:14:25 CEST 2011


New submission from Andreas Stührk <andy-python at hammerhartes.de>:

It's not possible (by intention) to instantiate a new instance of sys.flags. This is achieved by setting the "tp_new" slot to NULL (in `_PySys_Init()`), after `PyType_Ready()` is called, which means that a slot wrapper is added to the type dict for the "tp_new" slot (because the slot != NULL at that time). The problem is now that if one calls `sys.flags.__new__` directly, a null pointer dereference occurs in `tp_new_wrapper()`.

Attached is a patch that fixes the crash and adds a test.

----------
files: sys_flags__new__crash.patch
keywords: patch
messages: 145763
nosy: Trundle
priority: normal
severity: normal
status: open
title: sys.flags.__new__ crashes
type: crash
versions: Python 2.7, Python 3.2, Python 3.3
Added file: http://bugs.python.org/file23431/sys_flags__new__crash.patch

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue13204>
_______________________________________


More information about the New-bugs-announce mailing list