Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit b785518

Browse files
committed
IDLE didn't start correctly when Python was installed in "Program Files"
on W2K and XP. Python Bugs 780451, 784183 Backported to 2.2-maint
1 parent 8fd8def commit b785518

2 files changed

Lines changed: 19 additions & 2 deletions

File tree

Lib/idlelib/NEWS.txt

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,15 @@
1+
What's New in IDLE 1.0+?
2+
===================================
3+
4+
*Release date: XX-XXX-2003*
5+
6+
- IDLE didn't start correctly when Python was installed in "Program Files" on
7+
W2K and XP. Python Bugs 780451, 784183
8+
9+
- config-main.def documentation incorrectly referred to idle- instead of
10+
config- filenames. SF 782759 Also added note about .idlerc location.
11+
12+
113
What's New in IDLE 1.0?
214
===================================
315

Lib/idlelib/PyShell.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ def __init__(self, tkconsole):
318318

319319
def spawn_subprocess(self):
320320
args = self.subprocess_arglist
321-
self.rpcpid = os.spawnv(os.P_NOWAIT, args[0], args)
321+
self.rpcpid = os.spawnv(os.P_NOWAIT, sys.executable, args)
322322

323323
def build_subprocess_arglist(self):
324324
w = ['-W' + s for s in sys.warnoptions]
@@ -331,7 +331,12 @@ def build_subprocess_arglist(self):
331331
command = "__import__('idlelib.run').run.main(" + `del_exitf` +")"
332332
else:
333333
command = "__import__('run').main(" + `del_exitf` + ")"
334-
return [sys.executable] + w + ["-c", command, str(self.port)]
334+
if sys.platform[:3] == 'win' and ' ' in sys.executable:
335+
# handle embedded space in path by quoting the argument
336+
decorated_exec = '"%s"' % sys.executable
337+
else:
338+
decorated_exec = sys.executable
339+
return [decorated_exec] + w + ["-c", command, str(self.port)]
335340

336341
def start_subprocess(self):
337342
addr = (LOCALHOST, self.port)

0 commit comments

Comments
 (0)