[issue6415] warnings.warn segfaults on bad formatted string

Jerry Chen report at bugs.python.org
Sat Jul 4 19:23:25 CEST 2009


Jerry Chen <jerry at 3rdengine.com> added the comment:

Bug and patch confirmed on both py3k and python2.7 branches

Before:

$ ./python.exe warnsegfault.py 
this exception is caught: incomplete format
this exception is also caught: incomplete format
Bus error

After:

$ ./python.exe warnsegfault.py this exception is caught: incomplete format
this exception is also caught: incomplete format
Traceback (most recent call last):
  File "warnsegfault.py", line 21, in <module>
    warnings.warn(MyWarning())
  File "warnsegfault.py", line 10, in __str__
    return "A bad formatted string %(err)" % {"err" : "there is no %(err)s"}
ValueError: incomplete format

----------
nosy: +jcsalterego

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


More information about the Python-bugs-list mailing list