Karthikeyan Singaravelan <[email protected]> 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 <[email protected]>
<https://bugs.python.org/issue10417>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com