From ee105dcc62fd4500d7e25a7c6679e274bc220bd7 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Fri, 10 Jan 2014 22:43:03 +0200 Subject: [PATCH] Fixed test_tempfilepager in test_pydoc on Windows. Filename such as r'c:\users\db3l\appdata\local\temp\tmph3vkvf' contains '\t' which is interpreted by ast.literal_eval() as a tabulation. --- Lib/test/test_pydoc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Lib/test/test_pydoc.py b/Lib/test/test_pydoc.py index 61f52aad83..5c62f68f6b 100644 --- a/Lib/test/test_pydoc.py +++ b/Lib/test/test_pydoc.py @@ -473,8 +473,9 @@ class TestUnicode(unittest.TestCase): output = {} def mock_system(cmd): - import ast - output['content'] = open(ast.literal_eval(cmd.strip())).read() + filename = cmd.strip()[1:-1] + self.assertEqual('"' + filename + '"', cmd.strip()) + output['content'] = open(filename).read() saved, os.system = os.system, mock_system try: pydoc.tempfilepager(doc, '') -- 2.50.1