[issue11145] '%o' % user-defined instance

Amaury Forgeot d'Arc report at bugs.python.org
Mon Feb 7 20:09:13 CET 2011


Amaury Forgeot d'Arc <amauryfa at gmail.com> added the comment:

And this code will crash a debug build:

>>> class X(long):
...     def __oct__(self):
...         return 'foo'.upper()
...
>>> '%o' % X()
Assertion failed: buf[sign] == '0', file ..\..\Objects\stringobject.c, line 4059

----------
nosy: +amaury.forgeotdarc

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


More information about the Python-bugs-list mailing list