Terry J. Reedy added the comment:
On my win 10 machine, upgraded from win 7 a week ago, I have
C:/programs/Python27, ...34, and ...35. C:/Windows/system32 contains
python27.dll and ...34.dll, but not ...35.dll. For Idle 2.7 and 3.4, default
'Save As' directory is Python27 and ...34. (Saving to install directory is not
best but works.) For 3.5, it is indeed ...system32. This is wrong and bad.
The startup directory becomes '.', at the head of sys.path, the module search
path.
This is not an IDLE issue. Start console Python from the icon.
>>> import os; os.getcwd()
'C:\\Programs\\Python34' # 3.4
'C:\\WINDOWS\\System32' # 3.5
The following test of Python installed on Windows (preferably before release)
would have caught this regression/bug.
os.getcwd() == os.path.split(sys.executable)[0]
As for IDLE: in IOBinding.py, save_as (l.350) calls asksavefile (l.512). That
calls tkinter.filedialog.SaveAs().show with initialdir =
self.defaultfilename("save")[0]. defaultfilename (l.500) defaults to
os.getcwd(), which, as above, returns ...system32.
I believe this is an installation bug of not specifying the startup directory
for the 3.5 Python and IDLE icons (others should be checked also).
The 3.4 IDLE Icon Properties dialog has 'Target: Python 3.4.3 (64bit)', the
latter in grayed-out read-only unselectable text and Start in:
C:\Programs\Python34\, the latter rather dangerously pre-selecteed (and hence
too easy to inadvertently alter or delete).
The 3.5 dialog has '''Target: C:\Programs\Python35\pythonw.exe
"C:\Programs\Python35\Lib\idlelib\idle.pyw"''', with the target preselected.
This change is useful since users can add IDLE startup arguments at the end,
such as '-s' to execute PYTHONSTARTUP.
However, 'Start in:' is blank and for what ever reason, the default is
...system32. Putting C:\Programs\Python35\ there fixes the problem, and that
or something should be there on installation. When I start IDLE on a command
line with "python -m idlelib", the start 'directory' is "Desktop /n Terry",
which is an alias for c:\Users\Terry. For most people, that is a better default
directory than the install directory.
Larry, Maja is the 2nd or 3rd teacher to report this problem. See python-list
thread "teacher need help!"
https://mail.python.org/pipermail/python-list/2015-October/698054.html
for one who had problems on 3 of 13 machines and in desperation "formatted the
machines, reinstalling everything, including Python."
Maja, the recurring problem may have been due to the bad startup directory
being the first directory searched for imports. Or it it may be due to
'C:\Windows\system34\turtle.py' being recorded in <home
directory>/.idlerc/recent-files.lst, which is used for File -> Recent Files.
Although IDLE deletes at least some bad entries, the ultimate solution to
problems with that file is for a user to edit and delete bad names or delete
the file entirely.
----------
components: +Installation -IDLE
priority: normal -> release blocker
stage: -> needs patch
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue25450>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com