New submission from Armin Rigo <ar...@users.sourceforge.net>:

The __str__ method of some exception classes reads attributes without
typechecking them.  Alternatively, the issue could be that the user is
allowed to set the value of these attributes directly, without
typecheck.  The typechecking is only done when we create the exception,
but not later.  Example:

>>> u=UnicodeTranslateError(u'x', 1, 5, 'bah')
>>> u.reason = 0x345345345345345345  
>>> str(u)
"can't translate characters in position 1-4: E\x03"

The 'E\x03' comes from PyString_AS_STRING(reason).  By playing enough it
is probably possible to come up with a real crasher.

----------
components: Interpreter Core
messages: 95159
nosy: arigo
severity: normal
status: open
title: crasher in str(Exception())
versions: Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue7309>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to