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.

classification
Title: Give modulefinder some much-needed updates.
Type: enhancement Stage: resolved
Components: Library (Lib) Versions: Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: barry, brandtbucher, brett.cannon, jvr, ncoghlan
Priority: normal Keywords: patch, patch

Created on 2019-02-08 03:13 by brandtbucher, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 11787 merged brandtbucher, 2019-02-08 03:23
PR 11787 merged brandtbucher, 2019-02-08 03:23
Messages (4)
msg335054 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2019-02-08 03:20
I've written a patch here that includes a few useful fixes. Namely:

- It doesn't crash if it encounters a syntax error. (17396)
- It doesn't report certain name collisions as bad. (35376)
- It doesn't use mutable default arguments in its initializer.
- Most importantly, it now uses `importlib` instead of `imp`, which is deprecated. (25160) As a benefit, frozen built-in modules (`zip import`, for example), are now correctly reported.

With the exception of these bug fixes, I've been very careful to preserve the original behavior, and have not changed any part of the API. This patch also includes 2 new regression tests.
msg335171 - (view) Author: Brandt Bucher (brandtbucher) * (Python committer) Date: 2019-02-10 19:20
Alright, I've gotten all of the tests passing for the new importlib-only implementation. I broke these modifications out into a new private function, _find_module, to make it clear that this fix is a simple drop-in replacement for imp.find_module.

Let me know if there's anything I've missed or could improve. Otherwise, I feel my work here is done!
msg339560 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2019-04-07 08:00
New changeset 9d7b2c0909b78800d1376fd696f73824ea680463 by Nick Coghlan (Brandt Bucher) in branch 'master':
bpo-35936: Updates to modulefinder (GH-11787)
https://github.com/python/cpython/commit/9d7b2c0909b78800d1376fd696f73824ea680463
msg339561 - (view) Author: Nick Coghlan (ncoghlan) * (Python committer) Date: 2019-04-07 08:03
Thanks Brandt!

I'll also go back and close #17396, #35376, and #25160
History
Date User Action Args
2022-04-11 14:59:11adminsetgithub: 80117
2019-04-07 08:03:40ncoghlansetstatus: open -> closed
messages: + msg339561

keywords: patch, patch
resolution: fixed
stage: patch review -> resolved
2019-04-07 08:00:48ncoghlansetmessages: + msg339560
2019-02-12 22:39:36brandtbuchersetnosy: + barry, brett.cannon, ncoghlan
2019-02-10 19:20:46brandtbuchersetmessages: + msg335171
2019-02-08 16:31:09SilentGhostsetkeywords: patch, patch
nosy: + jvr
2019-02-08 03:23:58brandtbuchersetkeywords: + patch
stage: patch review
pull_requests: + pull_request11780
2019-02-08 03:23:56brandtbuchersetkeywords: + patch
stage: (no value)
pull_requests: + pull_request11779
2019-02-08 03:20:39brandtbuchersetmessages: + msg335054
versions: + Python 3.8, - Python 3.4
2019-02-08 03:13:18brandtbuchercreate