Author terry.reedy
Recipients ethan.furman, mark, ned.deily, serhiy.storchaka, terry.reedy
Date 2014-08-02.20:48:05
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1407012485.52.0.693705578976.issue22121@psf.upfronthosting.co.za>
In-reply-to
Content
Mark's opening statement is incomplete. The actual situation is more complex, and probably not documented anywhere except in the code -- and the system-specific behavior not even there. Let 'working directory' mean the initial directory of an Open or Save As dialog opened from a particular window. By experiment, each window has its own working directory.

For Editor windows with a named file, the working directory is the directory of the file. Note that recently edited file can be opened from File / Recent Files, bypassing the Open dialog. (Side issue: the number of recent files kept should be expanded.) I sometimes open a file to get to its directory.  Untitled Editor widows inherit the working directory from the active window where File / New File or control-N was invoked.

Output windows inherit the Shell working directory.  Currently, the Shell working directory is the current working directory of the python(w) process it is running in.  If python is started from a command line*, it inherits the console cwd.  If python is started from a python or idle icon, its current directory is that of the python executable -- but apparently only on Windows.  When Python is installed, the executable is in the install directory that also contains /lib.  In a Windows repository build, the executable in /pcbuild, next to /lib.  (Another side issue: this is a nuisance and currently disables File / Load Module Alt-m.)

* with, for instance, "python -m idlelib"

This issue should only be about changing the Shell working directory when it would otherwise be the executable directory (from an icon start, the last case in the previous paragraph).  This can be tested by looking for 'python.exe'.  We could add a new config option to the Startup Preferences block of the General tab of the config dialog. Subissue: perhaps this option, unlike most, should have a command line option.

A binary option would be sufficient to switch to the user's home directory. But especially for beginners, and especially for children (Mark's presented use case on python-list), this is not the right place. Splattering .py files in ~HOME is not tremendously better than doing the same in the executable directory. So I think there should be an entry box where someone could enter, for instance, '~/Python'. Starting in a particular directory, rather than having to switch to a Python-files directory, would not be Windows-specific.

The current Windows behavior of starting in the version-specific python tree is very handy when working on python itself. But I guess using Pathbrowser would be a substitute for that.
History
Date User Action Args
2014-08-02 20:48:05terry.reedysetrecipients: + terry.reedy, mark, ned.deily, ethan.furman, serhiy.storchaka
2014-08-02 20:48:05terry.reedysetmessageid: <1407012485.52.0.693705578976.issue22121@psf.upfronthosting.co.za>
2014-08-02 20:48:05terry.reedylinkissue22121 messages
2014-08-02 20:48:05terry.reedycreate