On Mon, Apr 16, 2018 at 10:23 AM, Brett Cannon <brett@python.org> wrote:


On Mon, 16 Apr 2018 at 09:58 Eric Fahlgren <ericfahlgren@gmail.com> wrote:
The documentation is pretty opaque or non-existent on other aspects of importlib use, too.

Well, we are diving into the dark corners of import here. (Details can be found in the language reference: https://docs.python.org/3/reference/import.html)

Thanks, Brett, I'll read through that and see where I get.  Those corners /are/ pretty dark.

The backstory is that I'm doing the final port from Py2 to Py3 (it's been a long time coming, mostly years of waiting for extension modules to get ported, notably wxPython and VTK).  In Py2, all warnings were enabled and disallowed, so big surprise on first run, hundreds of lines of the aforementioned one and "ImportWarning: __package__ != __spec__.parent".  We have manually defined "__package__" all over the place, for reasons lost in the fog of time, which I believe to be the culprit for the latter warning.

Eric