Author terry.reedy
Recipients python-dev, serhiy.storchaka, terry.reedy
Date 2016-07-06.01:55:35
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Ah, the invocation I did not test ;-).  It does not matter in this case because "os.path.dirname('')" is '' and the join leaves relative names for the config files that work fine for opening them.


 {'keys': <__main__.IdleConfParser object at 0x000002633B200080>,

At one time, I thought, sys.path[0] was '', representing the current directory, and not the absolute path of the starting directory.  I am not sure if there are any cross platform, cross implementation, guarantees. 

There are 12 other idlelib files using __file__.  I ran each in either idlelib or idle_test as appropriate.  11 run. fails at this line (which I wrote)
  helpfile = join(abspath(dirname(dirname(__file__))), 'help.html')
as the double dirname does not have the expected effect. A version of the conditional from config, with dirname(sys.path[0]), would work.  However, taking the abspath first is easier.
  helpfile = join(dirname(dirname(abspath(__file__))), 'help.html')

The comment in config appears to refer to the exec command/function.  I don't know what either does with __name__, __file__, or sys.path.

With the two IdleConf dict keys sorted, the first patch results in consistent output.  configparser.ConfigParser uses OrderedDicts by default, so re-running on unchanged files results in unchanged iteration order.
Date User Action Args
2016-07-06 01:55:37terry.reedysetrecipients: + terry.reedy, python-dev, serhiy.storchaka
2016-07-06 01:55:37terry.reedysetmessageid: <>
2016-07-06 01:55:37terry.reedylinkissue27452 messages
2016-07-06 01:55:35terry.reedycreate