This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author neves
Recipients neves
Date 2008-05-10.18:47:02
SpamBayes Score 0.0106084
Marked as misclassified No
Message-id <>
Doctest doesn't obey the specified file encoding for unicode literals.

I've put the minimum test case that demonstrate the error in the
attached file. 

The program has the # -*- coding: utf-8 -*- as the first line and is
saved in this encoding. My computer  environment is configured as
iso8859-1. Doctest ignores the file encoding specification and
interprets the u'á' as u'á' (the utf-8 text decoded as iso8859-1 )

I've reproduced this error in python 2.5 in linux and windows.

This is the output of the program below that runs the function normalize
from inside doctest and directly from python. They show different results.

File "", line 7, in __main__.normalize
Failed example:
1 items had failures:
   1 of   1 in __main__.normalize
***Test Failed*** 1 failures.
without doctest ===>>> b
Date User Action Args
2008-05-10 18:47:12nevessetspambayes_score: 0.0106084 -> 0.0106084
recipients: + neves
2008-05-10 18:47:10nevessetspambayes_score: 0.0106084 -> 0.0106084
messageid: <>
2008-05-10 18:47:09neveslinkissue2811 messages
2008-05-10 18:47:05nevescreate