Terry J. Reedy added the comment:

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.

----------
nosy: +terry.reedy
stage:  -> needs patch
versions: +Python 2.7

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue22121>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to