msg212615 - (view) |
Author: Armin Ronacher (aronacher) *  |
Date: 2014-03-03 07:43 |
pkgutil.get_loader calls pkgutil.find_loader which calls importlib.find_loader The latter logs a deprecation warning about it being replaced by importlib.util.find_spec. This is a regression in 3.4 as far as I can see. |
|
|
msg212618 - (view) |
Author: Armin Ronacher (aronacher) *  |
Date: 2014-03-03 08:23 |
This also happens with the latest hg version. I could not make an isolated test case unfortunately but it happens on the flask testsuite if run on 3.4. |
|
|
msg212629 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-03-03 11:31 |
Ah, I think I see what may have happened - when we finally switched all the stdlib importers over to PEP 302 (and consistently set __loader__), the pkgutil.get_loader fallback to pkgutil.find_loader stopped being exercised by the test suite (it's currently missing lower level unit tests), and so we missed that it was still calling a deprecated API. (And we don't currently have any CI set up to warn us when coverage of a module goes backwards) I'll add some new tests to get coverage and change it to use importlib.util.find_spec instead. |
|
|
msg212631 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-03-03 11:39 |
Attached patch adds some appropriate unit tests, switches pkgutil.find_loader over to using importlib.util.find_spec and updates the docs appropriately. I also filed issue 20842 relating to the fact that the pkgutil docs still refer to PEP 302 when they should be referring to the glossary terms instead. |
|
|
msg212632 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-03-03 11:59 |
Brett, Eric - if this looks right to you, feel free to commit and create the issue for Larry to incorporate it into 3.4.0. |
|
|
msg212640 - (view) |
Author: Brett Cannon (brett.cannon) *  |
Date: 2014-03-03 14:58 |
LGTM, but I won't be able to commit it until Friday so hopefully Eric or you can do it sooner. |
|
|
msg212675 - (view) |
Author: Alyssa Coghlan (ncoghlan) *  |
Date: 2014-03-03 21:31 |
OK, I can add it tonight. |
|
|
msg212708 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-03-04 10:39 |
New changeset ea827c809765 by Nick Coghlan in branch 'default': Close #20839: pkgutil.find_loader now uses importlib.util.find_spec http://hg.python.org/cpython/rev/ea827c809765 |
|
|
msg213815 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2014-03-17 06:30 |
New changeset a8b30fd6ee4f by Nick Coghlan in branch '3.4': Close #20839: pkgutil.find_loader now uses importlib.util.find_spec http://hg.python.org/cpython/rev/a8b30fd6ee4f |
|
|