[issue14344] repr of email policies is wrong

Éric Araujo report at bugs.python.org
Sat Mar 17 16:54:09 CET 2012


Éric Araujo <merwok at netwok.org> added the comment:

I don’t understand why the repr should use \\r instead of \r.  It seems to work:

>>> from email.policy import Policy, HTTP, strict
>>> strict
Policy(raise_on_defect=True)
>>> eval(repr(strict))
Policy(raise_on_defect=True)
>>> HTTP
Policy(linesep='\r\n', max_line_length=None)
>>> eval(repr(HTTP))
Policy(linesep='\r\n', max_line_length=None)
>>> HTTP.__dict__
{'max_line_length': None, 'linesep': '\r\n'}
>>> eval(repr(HTTP)).__dict__
{'max_line_length': None, 'linesep': '\r\n'}

----------

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


More information about the Python-bugs-list mailing list