Message26301
I made some tests with Python 2.5 on an Ubuntu Edgy system with an UTF-8 terminal. Here's the basic test which does work correctly:
# -*- encoding: utf-8 -*-
__doc__ = u"""
>>> print u'ä'
ä
""" ; import doctest ; doctest.testmod()
If I start to vary the "ä" (a with umlaut) characters in "print u'ä'" (the test) and the "ä" below it (expected result), I get a UnicodeEncodeError whenever doctest tries to print a message about non-matching test output.
Here's a summary of my results in the format of
test | expected result | success/failure
Note that \u00e4 is unicode for the "ä" character.
ä | ä | success
\u00e4 | ä | success
ä | \u00e4 | success
\u00e4 | \u00e4 | success
ä | x | fails to display message
x | ä | fails to display message
\u00e4 | x | fails to display message
x | \u00e4 | fails to display message
Conclusion: test running and output checking do work correctly, but there's a problem displaying messages about non-matching output whenever either the expected output or the output produced by the test contain any extended characters.
The doctest documentation doesn't give any hint on work-arounds. |
|
Date |
User |
Action |
Args |
2007-08-23 14:34:37 | admin | link | issue1293741 messages |
2007-08-23 14:34:37 | admin | create | |
|