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 martin.panter
Recipients martin.panter, ncoghlan, sleepycal
Date 2015-12-01.03:52:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1448941951.14.0.744147420262.issue25708@psf.upfronthosting.co.za>
In-reply-to
Content
I think there are a couple of related bugs here, with open reports:

1. Issue 14285: runpy catches various exceptions including AttributeError, and incorrectly assumes this means you gave it a bad module or package name.

2. Issue 19771: runpy incorrectly interprets exceptions such as in (1) as meaning the package doesn’t have a __main__ submodule. But these exceptions can happen even if hello.__main__ exists. My patch there changes the error message to:

/home/proj/python/cpython/python: Error while finding spec for 'hello.__main__' (AttributeError: module 'random' has no attribute 'dsgjdgj')

3. Issue 16217: runpy should handle exceptions from user code by printing out the relevant traceback, rather than letting the Python interpreter print out all the internal runpy frames.

Marking this as a dupe of Issue 14285, but I think a proper solution to that would probably affect the other two as well.
History
Date User Action Args
2015-12-01 03:52:31martin.pantersetrecipients: + martin.panter, ncoghlan, sleepycal
2015-12-01 03:52:31martin.pantersetmessageid: <1448941951.14.0.744147420262.issue25708@psf.upfronthosting.co.za>
2015-12-01 03:52:31martin.panterlinkissue25708 messages
2015-12-01 03:52:30martin.pantercreate