From: Serhiy Storchaka Date: Fri, 10 Jan 2014 20:43:03 +0000 (+0200) Subject: Fixed test_tempfilepager in test_pydoc on Windows. X-Git-Tag: v2.7.8~136 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee105dcc62fd4500d7e25a7c6679e274bc220bd7;p=python 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. --- 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, '')