Nick Coghlan added the comment: We don't want to restore Python 2.5 behaviour - directories containing a __main__.py file are meant to be executable in 2.6. With your proposed change test_cmd_line_script will fail its directory execution tests (since those rely on the default importer to find the code for __main__).
Georg is rightly complaining about the way that the implementation details leak through in the error message when __main__ isn't found. It makes perfect sense to me, but anyone that isn't intimately familiar with the import system is going to be left scratching their heads and wondering what is going on. I'm currently pondering an approach that involves trapping the ImportError in _run_module_as_main and displaying different error messages based on whether or not the module being looked for is called __main__, and whether or not sys.argv[0] is a directory. __________________________________ Tracker <[EMAIL PROTECTED]> <http://bugs.python.org/issue1877> __________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com