Kaydet (Commit) 52f80a70 authored tarafından Serhiy Storchaka's avatar Serhiy Storchaka

Issue #16829: IDLE printing no longer fails if there are spaces or other

special characters in the file path.
import os import os
import types import types
import shlex
import sys import sys
import codecs import codecs
import tempfile import tempfile
...@@ -458,7 +459,7 @@ class IOBinding: ...@@ -458,7 +459,7 @@ class IOBinding:
else: #no printing for this platform else: #no printing for this platform
printPlatform = False printPlatform = False
if printPlatform: #we can try to print for this platform if printPlatform: #we can try to print for this platform
command = command % filename command = command % shlex.quote(filename)
pipe = os.popen(command, "r") pipe = os.popen(command, "r")
# things can get ugly on NT if there is no printer available. # things can get ugly on NT if there is no printer available.
output = pipe.read().strip() output = pipe.read().strip()
......
...@@ -217,6 +217,9 @@ Core and Builtins ...@@ -217,6 +217,9 @@ Core and Builtins
Library 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 - 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 duplication. Thanks to Ronan Lamy for the report and taking an initial stab
at the problem. at the problem.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment