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 ncoghlan
Date 2017-03-28.09:48:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1490694499.88.0.53522303002.issue29929@psf.upfronthosting.co.za>
In-reply-to
Content
A key enabler for actually pursuing this idea would be coming up with a feasible way of emitting a deprecation warning for code that relied on the old implicit relative imports. A reasonable fast check for that would be to:

1. Start populating a private sys._main_path_entry in the sys module in addition to including it in both __main__.__path__ and sys.path

2. During the deprecation period, emit a warning when an import is satisfied from the sys._main_path_entry directory and the fully qualified module name *doesn't* start with "__main__."

3. After the deprecation period, stop populating sys.path[0], stop setting sys._main_path_entry, and stop emitting the deprecation warning

There's still plenty of details to be worked out before this idea could become reality (especially in terms of how it relates to module execution with the -m switch), but both the idea and a managed migration away from the status quo seem like they should be feasible.
History
Date User Action Args
2017-03-28 09:48:19ncoghlansetrecipients: + ncoghlan
2017-03-28 09:48:19ncoghlansetmessageid: <1490694499.88.0.53522303002.issue29929@psf.upfronthosting.co.za>
2017-03-28 09:48:19ncoghlanlinkissue29929 messages
2017-03-28 09:48:19ncoghlancreate