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 ncoghlan
Recipients Fotis.Koutoulakis, ncoghlan
Date 2013-12-09.01:26:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
By providing a submodule, a package is saying "I am directly executable". When runpy says it isn't (because running that file happened to raise ImportError), then runpy is wrong.

runpy can't make the file work (it's genuinely broken), but it can avoid reporting a misleading error message - that's the bug to be fixed.

As far as the testing goes, if you look at the existing runpy tests, the usual approach is to create a temporary directory, write out a package with the desired behaviour, and then run it from there. So, for this test, it's a matter of copying the general structure of the existing package execution test in test_runpy, but replacing the body of the file with something like "raise ImportError('This should not be replaced')"
Date User Action Args
2013-12-09 01:26:23ncoghlansetrecipients: + ncoghlan, Fotis.Koutoulakis
2013-12-09 01:26:22ncoghlansetmessageid: <>
2013-12-09 01:26:22ncoghlanlinkissue19771 messages
2013-12-09 01:26:21ncoghlancreate