-
-
Notifications
You must be signed in to change notification settings - Fork 2.8k
UnicodeDecodeError (INTERNALERROR) when doctests contain Unicode #628
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Original comment by Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco): The test that elicited this error has been around for a long time in the irc library. I'm pretty sure the test worked at one time, but I even rolled back to pytest 2.5.2, and it still failed (though more silently). I suspect the issue lies in py. |
Related to #710? |
Re-notifying @jaraco |
I don't think it is related. 710 is about comparing matching and non-matching results and this issue is when a Unicode character not in the file system encoding (or maybe another encoding) appears in a failing doctest. I haven't tried this on a non-Windows system, so I'll do that now to see if it behaves differently or if I can identify which encoding is relevant. |
On OS X, the test fails as expected:
On that system, getfilesystemencoding returns 'utf-8'. |
The following standalone Python script will replicate the error message when run on Windows or any other system where
|
It seems the issue is that something in the doctest runner is saving the output to a file using UTF-8 encoding, but then when it attempts to read that file, it defaults to |
@jaraco should one of us pick it up, I have @nicoddemus in mind |
@RonnyPfannschmidt Yes, please - if possible. I don't have any actions or ideas pending beyond what I've mentioned above. |
Originally reported by: Jason R. Coombs (BitBucket: jaraco, GitHub: jaraco)
Consider this test:
Note that isn't the letter 'c' but instead Cyrillic 's'.
Save it as mod.py, then invoke
pytest --doctest-modules
. It will fail with this output:The text was updated successfully, but these errors were encountered: