summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-12 16:17:24 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-12 16:17:24 (GMT)
commit52f80a704172052f5eca8e84d93500427fc400f2 (patch)
tree8e3bb23de4d04d3ad657b9a7f64d3ed1b9859a2c
parent6c566b3ce9a2c3b27f7f90ec0151d187403ead38 (diff)
parent69db587f86cb1a742561c5afebae67b58761420e (diff)
downloadcpython-52f80a704172052f5eca8e84d93500427fc400f2.zip
cpython-52f80a704172052f5eca8e84d93500427fc400f2.tar.gz
cpython-52f80a704172052f5eca8e84d93500427fc400f2.tar.bz2
Issue #16829: IDLE printing no longer fails if there are spaces or other
special characters in the file path.
-rw-r--r--Lib/idlelib/IOBinding.py3
-rw-r--r--Misc/NEWS3
2 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index 9b63928..dda3634 100644
--- a/Lib/idlelib/IOBinding.py
+++ b/Lib/idlelib/IOBinding.py
@@ -1,5 +1,6 @@
import os
import types
+import shlex
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 % 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 --git a/Misc/NEWS b/Misc/NEWS
index 1d08551..c2a6802 100644
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -217,6 +217,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 #15031: Refactor some .pyc management code to cut down on code
duplication. Thanks to Ronan Lamy for the report and taking an initial stab
at the problem.