[issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2020-04-26 Thread Zachary Ware


Zachary Ware  added the comment:

With 2.7 now EOL, I'm closing the issue.

--
nosy: +zach.ware
resolution:  -> out of date
stage: test needed -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2019-04-17 Thread Serhiy Storchaka


Serhiy Storchaka  added the comment:

I mean that '\xe4'.encode(encoding, 'backslashreplace') will fail.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2019-04-17 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

> Test that your fix does not break the case of 8-bit non-ascii docstring.

Do you mean double escaping of the backslash as in t\xe4st changed to t\\xe4st 
due to this PR? 

➜  cpython git:(bpo10417) $ cat /tmp/foo.py
# -*- coding: utf-8 -*-
import unittest

class UnicodeTest(unittest.TestCase):
def test_unicode_docstring(self):
u"""docstring with unicode character. t\xe4st"""
self.assertEqual(1+1, 2)

if __name__ == '__main__':
unittest.main()

# ASCII encoding

➜  cpython git:(bpo10417) $ PYTHONIOENCODING=ascii ./python.exe /tmp/foo.py 
--verbose
test_unicode_docstring (__main__.UnicodeTest)
docstring with unicode character. t\xe4st ... ok

--
Ran 1 test in 0.019s

OK

# utf-8 encoding

➜  cpython git:(bpo10417) $ ./python.exe /tmp/foo.py --verbose
test_unicode_docstring (__main__.UnicodeTest)
docstring with unicode character. täst ... ok

--
Ran 1 test in 0.004s

OK

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue10417] [2.7] unittest triggers UnicodeEncodeError with non-ASCII character in the docstring of the test function

2019-04-15 Thread STINNER Victor


Change by STINNER Victor :


--
nosy:  -vstinner
title: unittest triggers UnicodeEncodeError with non-ASCII character in the 
docstring of the test function -> [2.7] unittest triggers UnicodeEncodeError 
with non-ASCII character in the docstring of the test function

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com