From: Serhiy Storchaka Date: Sat, 12 Jan 2013 16:13:24 +0000 (+0200) Subject: Issue #16829: IDLE printing no longer fails if there are spaces or other X-Git-Tag: v3.2.4rc1~226 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=74fe9f307de7557282ed2b01268272efef45a910;p=thirdparty%2FPython%2Fcpython.git Issue #16829: IDLE printing no longer fails if there are spaces or other special characters in the file path. --- diff --git a/Lib/idlelib/IOBinding.py b/Lib/idlelib/IOBinding.py index 9528c9acaa04..c4f14efc27fd 100644 --- a/Lib/idlelib/IOBinding.py +++ b/Lib/idlelib/IOBinding.py @@ -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() diff --git a/Misc/NEWS b/Misc/NEWS index 26ec822874b5..a88c8883362b 100644 --- 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.