Index: Lib/pdb.py =================================================================== --- Lib/pdb.py (revision 77684) +++ Lib/pdb.py (working copy) @@ -1200,7 +1200,7 @@ self._wait_for_mainpyfile = 1 self.mainpyfile = self.canonic(filename) self._user_requested_quit = 0 - statement = 'execfile( "%s")' % filename + statement = 'execfile(%r)' % filename self.run(statement) # Simplified interface Index: Lib/test/test_pdb.py =================================================================== --- Lib/test/test_pdb.py (revision 0) +++ Lib/test/test_pdb.py (revision 0) @@ -0,0 +1,30 @@ +import sys +import os +import subprocess +import unittest + +class Tester(unittest.TestCase): + # if the filename has something that resolves to a python + # escape character (such as \t), it will fail + test_fn = '.\\test7750.py' + + def test_issue7750(self): + # the issue does not apply if os.sep is not backslash + if not os.path.sep == '\\': return + with open(self.test_fn, 'w') as f: + f.write('print("hello world")') + cmd = [sys.executable, '-m', 'pdb', self.test_fn,] + proc = subprocess.Popen(cmd, + stdout=subprocess.PIPE, + stdin=subprocess.PIPE, + stderr=subprocess.STDOUT, + ) + stdout, stderr = proc.communicate('q\n') + self.assertFalse('IOError' in stdout, "pdb munged the filename") + + def tearDown(self): + if os.path.isfile(self.test_fn): + os.remove(self.test_fn) + +if __name__ == '__main__': + unittest.main() \ No newline at end of file Property changes on: Lib\test\test_pdb.py ___________________________________________________________________ Added: svn:keywords + Id Rev Author Date