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 61f52aa..5c62f68 100644
--- a/Lib/test/test_pydoc.py
+++ b/Lib/test/test_pydoc.py
@@ -473,8 +473,9 @@
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, '')