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 brett.cannon, eric.snow, martin.panter, ncoghlan, wolma
Date 2016-07-14.03:44:38
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1468467878.43.0.00339039871135.issue27487@psf.upfronthosting.co.za>
In-reply-to
Content
Perhaps a suitable outcome here would be to just add an unconditional RuntimeWarning when the target of "-m" is already in sys.modules after the parent package import, along the lines of:

"RuntimeWarning: '<module>' already in sys.modules prior to '__main__' execution; this may result in unpredictable behaviour"

Then if folks get the "ValueError: package.module.__spec__ is not set" message, that would be an example of the noted "unpredictable behaviour", and the suggested resolution would be the path Wolfgang took: find a way to eliminate the warning when executing that particular module as __main__.
History
Date User Action Args
2016-07-14 03:44:38ncoghlansetrecipients: + ncoghlan, brett.cannon, eric.snow, martin.panter, wolma
2016-07-14 03:44:38ncoghlansetmessageid: <1468467878.43.0.00339039871135.issue27487@psf.upfronthosting.co.za>
2016-07-14 03:44:38ncoghlanlinkissue27487 messages
2016-07-14 03:44:38ncoghlancreate