This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE (windows) with PYTHONPATH and multiple python versions
Type: enhancement Stage: resolved
Components: IDLE Versions: Python 3.4
process
Status: closed Resolution: works for me
Dependencies: Superseder:
Assigned To: Nosy List: BreamoreBoy, Jimbofbx, eryksun, ncoghlan, r.david.murray, roger.serwy, terry.reedy
Priority: normal Keywords:

Created on 2012-08-24 20:44 by Jimbofbx, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (7)
msg169082 - (view) Author: James Hutchison (Jimbofbx) Date: 2012-08-24 20:44
One issue I've encountered is someone else's software setting PYTHONPATH to their install directory of python. We have some old software that installs and uses python 2.3 scripts and unfortunately this prevents the IDLE shortcuts for newer versions of python from working correctly on the system. This could be remedied with -E being added to the shortcut, but windows doesn't allow me to directly edit the IDLE shortcut, and it hides how IDLE is being launched via Python in the first place, making it a challenge to create my own. I'd remove PYTHONPATH from the system environment variables except I don't know why it's set in the first place.

Suggestion: IDLE safe-mode which runs with -E OR include a batch file for IDLE so that I can easily append my own command line arguments and create my own shortcuts.
msg169083 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2012-08-24 20:51
I'm guessing that 'batch file' version of this request is answered by the new 'py' launcher command in Python3, which can also be used with other versions of Python.  The obscurity of configuring things on Windows isn't directly a Python problem, but perhaps there are docs we could add somewhere?
msg169170 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2012-08-26 19:31
Look in the registry at "Computer\HKEY_CLASSES_ROOT\Python.File\shell\" and then inspect the launch commands under "open\command" and "Edit with IDLE\command".
msg220055 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2014-06-08 20:21
Something on Windows configuration here https://docs.python.org/3/using/windows.html#excursus-setting-environment-variables
msg220071 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-08 23:40
There already is an idlelib/idle.bat that starts the corresponding python with

set CURRDIR=%~dp0
start "IDLE" "%CURRDIR%..\..\pythonw.exe" "%CURRDIR%idle.pyw" %1 %2 %3 %4 %5 %6 %7 %8 %9

Arguments added to the .bat command are passed on. So the enhancement requested already exists.

C:\Programs>python34\lib\idlelib\idle.bat, for instance, starts 3.4, and changing '34' to '33' or '27' starts 3.3 or 2.7.

python -E ignores PYTHON* environment variables. Unfortunately, this seems to prevent python from running idle. Adding -E to the above or directly to
C:\Programs\Python34>pythonw.exe Lib/idlelib/idle.pyw -E
results in a new prompts with no visible action. Since I do not have any PYTHON* vars to ignore, this puzzle me. Does this indicate a bug in the startup handling of -E? (Nick?)

Except for this puzzle, I would close this as a third party issue.
msg220080 - (view) Author: Eryk Sun (eryksun) * (Python triager) Date: 2014-06-09 04:13
`idle.pyw -E` passes an invalid argument, and pythonw.exe doesn't inherit the console to print the usage text to stderr. The -E option needs to be passed to the interpreter:

    C:\Python34>pythonw.exe -E Lib/idlelib/idle.pyw

Or run idlelib as a script:

    pyw -3 -Em idlelib
msg220081 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-06-09 04:38
Thanks for the correction.
History
Date User Action Args
2022-04-11 14:57:35adminsetgithub: 59984
2014-06-09 04:38:56terry.reedysetmessages: + msg220081
2014-06-09 04:38:41terry.reedysetstatus: open -> closed
resolution: works for me
stage: resolved
2014-06-09 04:13:15eryksunsetnosy: + eryksun
messages: + msg220080
2014-06-08 23:40:43terry.reedysetnosy: + ncoghlan
messages: + msg220071
2014-06-08 20:21:14BreamoreBoysetnosy: + BreamoreBoy
messages: + msg220055
2012-09-01 00:50:13terry.reedysetversions: - Python 2.6, Python 3.1, Python 2.7, Python 3.2, Python 3.3
2012-08-26 19:31:50roger.serwysetnosy: + roger.serwy
messages: + msg169170
2012-08-24 20:51:32r.david.murraysetnosy: + r.david.murray, terry.reedy
messages: + msg169083
2012-08-24 20:44:44Jimbofbxcreate