summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib
diff options
context:
space:
mode:
authorSerhiy Storchaka <storchaka@gmail.com>2013-01-12 16:16:18 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2013-01-12 16:16:18 (GMT)
commit69db587f86cb1a742561c5afebae67b58761420e (patch)
tree4dd41ea0cb7062b4d20d47f0163b42a6d41758d3 /Lib/idlelib
parentdbc744ac74d69576ff801bee40e0fde607e7f62b (diff)
parent74fe9f307de7557282ed2b01268272efef45a910 (diff)
downloadcpython-69db587f86cb1a742561c5afebae67b58761420e.zip
cpython-69db587f86cb1a742561c5afebae67b58761420e.tar.gz
cpython-69db587f86cb1a742561c5afebae67b58761420e.tar.bz2
Issue #16829: IDLE printing no longer fails if there are spaces or other
special characters in the file path.
Diffstat (limited to 'Lib/idlelib')
-rw-r--r--Lib/idlelib/IOBinding.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py
index ec50eb2..9fe0701 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()