Amaury Forgeot d'Arc <[EMAIL PROTECTED]> added the comment:

This has nothing to do with doctest. Starting with your script, I get:

>>> a = f()
>>> b = repr(a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\u0105' in
position 4: ordinal not in range(128)

__repr__() is supposed to return a str object. In your case, I suggest
to use %r instead of "%s":
    def __repr__(self):
        return '<%s %r>' % (self.__class__.__name__, self.x)

----------
nosy: +amaury.forgeotdarc
resolution:  -> invalid
status: open -> closed

_______________________________________
Python tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue3465>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to