Author terry.reedy
Recipients andyharrington, eryksun, jeff.allen, mark, ned.deily, rhettinger, serhiy.storchaka, steve.dower, terry.reedy
Date 2019-07-13.22:10:58
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1563055859.33.0.986799918571.issue22121@roundup.psfhosted.org>
In-reply-to
Content
Steve, there is a problem in both lines of this suggestion.

if os.path.normcase(os.getcwd()) == os.path.normcase(sys.prefix):
    os.chdir(get_default_location(sys.platform))

On my 3.8 repository build, 
>>> import os; os.getcwd()
'F:\\dev\\38\\PCbuild\\win32'
>>> import sys; sys.prefix
'F:\\dev\\38'
# Don't match.  The following does.
>>> os.path.dirname(sys.executable)
'F:\\dev\\3x\\PCbuild\\win32'

>>> get_default_location
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'get_default_location' is not defined

Raymond, I understand that you are saying that the current behavior when starting from a command prompt is correct (I agree) and depended upon.  I changed the title to be clear about that.  Starting IDLE from an icon includes starting python from an icon and then starting IDLE with 'import idlelib.idle', which I do routinely for repository builds.
History
Date User Action Args
2019-07-13 22:10:59terry.reedysetrecipients: + terry.reedy, rhettinger, andyharrington, mark, ned.deily, serhiy.storchaka, jeff.allen, eryksun, steve.dower
2019-07-13 22:10:59terry.reedysetmessageid: <1563055859.33.0.986799918571.issue22121@roundup.psfhosted.org>
2019-07-13 22:10:59terry.reedylinkissue22121 messages
2019-07-13 22:10:58terry.reedycreate