From eebcb5f7901171b505c7b039a3d5b874c7d72808 Mon Sep 17 00:00:00 2001 From: Serhiy Storchaka Date: Sat, 12 Jan 2013 18:12:27 +0200 Subject: [PATCH] Issue #16829: IDLE printing no longer fails if there are spaces or other special characters in the file path. --- Lib/idlelib/IOBinding.py | 3 ++- Misc/NEWS | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index e429c100ba..8078c3f4b7 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -7,6 +7,7 @@ import os import types +import pipes import sys import codecs import tempfile @@ -503,7 +504,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() diff --git a/Misc/NEWS b/Misc/NEWS index 43cfc64f71..b69e70c492 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -186,6 +186,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. -- 2.40.0