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

1  2 
Lib/idlelib/IOBinding.py
Misc/NEWS

index ec50eb2348fc3e870e27a8d31c2c0d1938a3c0e1,c4f14efc27fd1f6decc2e21c94cfda178d221baa..9fe07011332b092ad505ce1e7b804b84f4f5b1f4
@@@ -1,5 -1,6 +1,6 @@@
  import os
  import types
 -import pipes
++import shlex
  import sys
  import codecs
  import tempfile
@@@ -458,7 -459,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)
++            command = command % shlex.quote(filename)
              pipe = os.popen(command, "r")
              # things can get ugly on NT if there is no printer available.
              output = pipe.read().strip()
diff --cc Misc/NEWS
index d7778179ece9bb079ad18030f351ff485dc618f6,a88c8883362b918b28354f06e3555c6090d78f3d..1e4dea2f85c596c396e5975d595a207d33c29396
+++ b/Misc/NEWS
@@@ -147,8 -199,9 +147,11 @@@ Core and Builtin
  Library
  -------
  
+ - Issue #16829: IDLE printing no longer fails if there are spaces or other
+   special characters in the file path.
 +- Issue #16900: Issue a ResourceWarning when an ssl socket is left unclosed.
 +
  - 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.