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.

Author terry.reedy
Recipients Maja Tomic, kbk, paul.moore, roger.serwy, steve.dower, terry.reedy, tim.golden, zach.ware
Date 2015-10-21.04:27:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1445401666.86.0.857548734057.issue25450@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2015-10-21 04:27:46terry.reedysetrecipients: + terry.reedy, kbk, paul.moore, tim.golden, roger.serwy, zach.ware, steve.dower, Maja Tomic
2015-10-21 04:27:46terry.reedysetmessageid: <1445401666.86.0.857548734057.issue25450@psf.upfronthosting.co.za>
2015-10-21 04:27:46terry.reedylinkissue25450 messages
2015-10-21 04:27:45terry.reedycreate