]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Issue #16829: IDLE printing no longer fails if there are spaces or other
authorSerhiy Storchaka <storchaka@gmail.com>
Sat, 12 Jan 2013 16:13:24 +0000 (18:13 +0200)
committerSerhiy Storchaka <storchaka@gmail.com>
Sat, 12 Jan 2013 16:13:24 +0000 (18:13 +0200)
special characters in the file path.

Lib/idlelib/IOBinding.py
Misc/NEWS

index 9528c9acaa048e6235fb09f89a4d02974b01d61d..c4f14efc27fd1f6decc2e21c94cfda178d221baa 100644 (file)
@@ -1,5 +1,6 @@
 import os
 import types
+import pipes
 import sys
 import codecs
 import tempfile
@@ -458,7 +459,7 @@ class IOBinding:
         else: #no printing for this platform
             printPlatform = False
         if printPlatform:  #we can try to print for this platform
-            command = command % filename
+            command = command % pipes.quote(filename)
             pipe = os.popen(command, "r")
             # things can get ugly on NT if there is no printer available.
             output = pipe.read().strip()
index 26ec822874b56c3c877e4637deface3d4b624de6..a88c8883362b918b28354f06e3555c6090d78f3d 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -199,6 +199,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #16829: IDLE printing no longer fails if there are spaces or other
+  special characters in the file path.
+
 - Issue #13899: \A, \Z, and \B now correctly match the A, Z, and B literals
   when used inside character classes (e.g. '[\A]').  Patch by Matthew Barnett.