Author ncoghlan
Recipients Jeffrey.Armstrong, brett.cannon, eric.snow, ncoghlan, petr.viktorin
Date 2015-08-05.12:45:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1438778736.48.0.670819968208.issue24769@psf.upfronthosting.co.za>
In-reply-to
Content
This is an interesting find - thanks.

Adding Larry as 3.5 release manager to the cc here, as I think the right fix actually involves an API adjustment inside _imp.

One of the consequences of PEP 489 (multi-phase initialisation) was that builtin imports and extension module imports now share a lot more code, and that includes the fact that while we have both _imp.create_builtin and _imp.create_dynamic, they currently share a module level exec implementation in _imp.exec_dynamic.

However, the definition and implementation of _imp.exec_dynamic is still behind the same preprocessor guard as _imp.create_dynamic, hence the error reported here.

As far as a fix goes, rather than defining _imp.exec_dynamic unconditionally, my inclination is to say that merging the Python level APIs in addition to the underyling C level implementation represents a design mistake when we implemented the PEP, and there should be a separate _imp.exec_builtin function.

The fact that _imp.exec_dynamic just called _imp.exec_builtin internally would then be a pure CPython implementation detail, rather than something importlib specifically depended on.
History
Date User Action Args
2015-08-05 12:45:37ncoghlansetrecipients: + ncoghlan, brett.cannon, petr.viktorin, eric.snow, Jeffrey.Armstrong
2015-08-05 12:45:36ncoghlansetmessageid: <1438778736.48.0.670819968208.issue24769@psf.upfronthosting.co.za>
2015-08-05 12:45:35ncoghlanlinkissue24769 messages
2015-08-05 12:45:23ncoghlancreate