diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-20 21:46:06 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-20 21:46:06 (GMT) |
commit | 5e3d7a401d8568d3308b8928b146a9c306bc3ca8 (patch) | |
tree | 03ed582741171729bef1b65c37c406d6ac5e866e /Lib/test/test_pydoc.py | |
parent | e55181f517bbfc875065ce86ed3e05cf0e0246fa (diff) | |
download | cpython-5e3d7a401d8568d3308b8928b146a9c306bc3ca8.zip cpython-5e3d7a401d8568d3308b8928b146a9c306bc3ca8.tar.gz cpython-5e3d7a401d8568d3308b8928b146a9c306bc3ca8.tar.bz2 |
Issue #23374: Fixed pydoc failure with non-ASCII files when stdout encoding
differs from file system encoding (e.g. on Mac OS).
Diffstat (limited to 'Lib/test/test_pydoc.py')
-rw-r--r-- | Lib/test/test_pydoc.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 1427c77..6a44c22 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -35,6 +35,10 @@ try: except ImportError: threading = None +class nonascii: + 'Це не латиниця' + pass + if test.support.HAVE_DOCSTRINGS: expected_data_docstrings = ( 'dictionary for instance variables (if defined)', @@ -474,6 +478,11 @@ class PydocDocTest(unittest.TestCase): self.assertEqual(expected, result, "documentation for missing module found") + def test_not_ascii(self): + result = run_pydoc('test.test_pydoc.nonascii', PYTHONIOENCODING='ascii') + encoded = nonascii.__doc__.encode('ascii', 'backslashreplace') + self.assertIn(encoded, result) + def test_input_strip(self): missing_module = " test.i_am_not_here " result = str(run_pydoc(missing_module), 'ascii') |