diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-20 21:47:09 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2015-02-20 21:47:09 (GMT) |
commit | 7065f376e08bce1657904d3b2acb9989949f3efc (patch) | |
tree | 2e2faf88ac5e8d5298a0739ae4bc3fce12e731cd /Lib/test/test_pydoc.py | |
parent | 78a82491277bc4ed3058757857abffd6119aea8e (diff) | |
parent | 5e3d7a401d8568d3308b8928b146a9c306bc3ca8 (diff) | |
download | cpython-7065f376e08bce1657904d3b2acb9989949f3efc.zip cpython-7065f376e08bce1657904d3b2acb9989949f3efc.tar.gz cpython-7065f376e08bce1657904d3b2acb9989949f3efc.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 41ad792..e9fed0a 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -34,6 +34,10 @@ try: except ImportError: threading = None +class nonascii: + 'Це не латиниця' + pass + if test.support.HAVE_DOCSTRINGS: expected_data_docstrings = ( 'dictionary for instance variables (if defined)', @@ -460,6 +464,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') |