classification
Title: Patch to make 'idle.bat' run idle.pyw using appropriate Python interpreter (so 3.1's idle.bat does not accidently use python26.exe)
Type: behavior Stage: resolved
Components: IDLE, Windows Versions: Python 3.1, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: kbk Nosy List: brian.curtin, kbk, python-dev, srid, taleinat, terry.reedy, trentm
Priority: normal Keywords: patch

Created on 2009-06-29 20:45 by srid, last changed 2011-05-26 02:41 by kbk. This issue is now closed.

Files
File name Uploaded Description Edit
idle-use-curr-py.patch srid, 2009-06-29 20:45 review
idle-use-curr-py.patch srid, 2010-07-11 04:16 Updated patch to make idle.bat work irrespective of CWD
Messages (12)
msg89875 - (view) Author: Sridhar Ratnakumar (srid) Date: 2009-06-29 20:45
On Mon, 29 Jun 2009 09:56:53 -0700, Trent Mick <trentm@activestate.com>
wrote:

> Sridhar Ratnakumar wrote:
>> I installed ActivePython-3.1 to C:\Python31 but disabled the 
installer
>> option "Register as default Python" .. because, I use Python-2.6 by  
>> default.
>>
>> However, this disabling broke 3.1's IDLE. Clicking on 'idle.bat' or
>> 'idle.py' or 'idle.pyw' in C:\Python31\Lib\idle\ directory opens 
Python
>> 2.6's IDLE.
>>
>> Since the installer knows the path to Python - C:
\Python31\python.exe -
>> does it make sense to patch the idle.bat file to use this binary?
>
> IIRC there is a special NT batch file syntax that you can use do that
> idle.bat will look for python.exe in a relative path, so that you 
won't
> have to patch idle.bat after install (which would be a pain).
>
> Here, use this for idle.bat:
>
>    @echo off
>    set CURRDIR=%~dp0
>    start %CURRDIR%..\..\pythonw.exe idle.pyw
>
> Perhaps you could add a bug to core Python to change idle.bat to be 
that?
>
>
> Trent
>
msg109956 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2010-07-11 02:28
I will try to test this sometime, though I always start IDLE through the start menu.
msg110915 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-07-20 16:00
BTW, ActivePython (2.6 and 2.7 at the moment) includes this patched idle.bat. The start menu shortcut launches it.
msg122024 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-11-21 23:55
I don't think this is a feature request. This batch file should always run the version of the file for which the batch is installed. For it to be generic and end up using another installed version is incorrect. With that said...

Fixed in r86651, r86652, and r86653. Thanks for the patch.
msg122027 - (view) Author: Sridhar Ratnakumar (srid) Date: 2010-11-21 23:57
Brian,

The following line:

  start %CURRDIR%..\..\pythonw.exe %CURRDIR%idle.pyw %1 %2 %3 %4 %5 %6 %7 %8 %9

should be changed to:

  start "%CURRDIR%..\..\pythonw.exe" "%CURRDIR%idle.pyw" %1 %2 %3 %4 %5 %6 %7 %8 %9

This is required if Python is installed into a directory with whitespace in its path.
msg122028 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-11-21 23:59
True. I'll correct it.
msg122029 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2010-11-22 00:04
Corrected in r86655, r86656, and r86657.
msg128187 - (view) Author: Sridhar Ratnakumar (srid) Date: 2011-02-08 20:01
There is a bug with the patch. The first argument to the `start` command, if a quoted string, becomes the Window title, not the command to execute. Hence, idle.pyw is directly executed by Windows. Here's the correct command line:

start "IDLELAUNCH" "%CURRDIR%..\..\pythonw.exe" "%CURRDIR%idle.pyw" %1 %2 %3 %4 %5 %6 %7 %8 %9

Could you make this fix part of the upcoming 3.2?
msg128188 - (view) Author: Brian Curtin (brian.curtin) * (Python committer) Date: 2011-02-08 20:15
We're only a few days away from 3.2 final so it's too late. Once it goes out I'll make the adjustment and it'll be in 3.2.1.
msg135994 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-14 22:07
New changeset 536ec6206584 by Kurt B. Kaiser in branch '3.1':
Issue #6378: Further adjust idle.bat to start associated Python
http://hg.python.org/cpython/rev/536ec6206584

New changeset cd55c6960d86 by Kurt B. Kaiser in branch '3.2':
Merge from 3.1
http://hg.python.org/cpython/rev/cd55c6960d86

New changeset ec3e73a25d84 by Kurt B. Kaiser in branch 'default':
Merge from 3.2
http://hg.python.org/cpython/rev/ec3e73a25d84
msg136926 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2011-05-26 02:37
New changeset f3446f08187a by Kurt B. Kaiser in branch '2.7':
IDLE: #6378: Further adjust idle.bat to start associated Python
http://hg.python.org/cpython/rev/f3446f08187a
msg136927 - (view) Author: Kurt B. Kaiser (kbk) * (Python committer) Date: 2011-05-26 02:41
Updated.  Thanks, srid.
History
Date User Action Args
2011-05-26 02:41:43kbksetstatus: open -> closed

assignee: brian.curtin -> kbk
versions: + Python 3.3
nosy: + kbk

messages: + msg136927
resolution: fixed
stage: patch review -> resolved
2011-05-26 02:37:21python-devsetmessages: + msg136926
2011-05-14 22:07:12python-devsetnosy: + python-dev
messages: + msg135994
2011-02-08 20:15:40brian.curtinsetstatus: pending -> open
nosy: terry.reedy, taleinat, trentm, brian.curtin, srid
messages: + msg128188

resolution: fixed -> (no value)
stage: resolved -> patch review
2011-02-08 20:01:46sridsetstatus: closed -> pending
nosy: terry.reedy, taleinat, trentm, brian.curtin, srid
messages: + msg128187
2010-11-22 00:04:18brian.curtinsetmessages: + msg122029
2010-11-21 23:59:10brian.curtinsetmessages: + msg122028
2010-11-21 23:57:19sridsetmessages: + msg122027
2010-11-21 23:55:18brian.curtinsetstatus: open -> closed

type: enhancement -> behavior
assignee: brian.curtin
versions: + Python 3.1, Python 2.7
nosy: + brian.curtin

messages: + msg122024
resolution: fixed
stage: resolved
2010-07-20 16:00:38sridsetmessages: + msg110915
2010-07-20 15:33:33taleinatsetnosy: + taleinat
2010-07-11 04:16:06sridsetfiles: + idle-use-curr-py.patch
2010-07-11 02:28:23terry.reedysetnosy: + terry.reedy

messages: + msg109956
versions: + Python 3.2, - Python 2.6, Python 3.1, Python 2.7
2010-05-25 23:24:00sridsettype: behavior -> enhancement
versions: + Python 2.7
2009-06-29 21:36:54trentmsetnosy: + trentm
2009-06-29 20:45:21sridcreate