Title: modulefinder skips nested modules with same name as top-level bad module
Type: behavior Stage: patch review
Components: Library (Lib) Versions: Python 3.8, Python 3.7, Python 3.6, Python 2.7
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: eric.snow, jvr, ncoghlan, rdb
Priority: normal Keywords: patch

Created on 2018-12-02 15:00 by rdb, last changed 2019-02-08 03:24 by brandtbucher.

File name Uploaded Description Edit
patch.diff rdb, 2018-12-02 15:00 Patch (made against 3.6 branch)
Pull Requests
URL Status Linked Edit
PR 10895 open rdb, 2018-12-04 15:37
PR 11787 open brandtbucher, 2019-02-08 03:24
Messages (2)
msg330883 - (view) Author: rdb (rdb) * Date: 2018-12-02 15:00
If modulefinder finds a nested module import (eg. 'import a.b.c') while there is a top-level module with the same name (eg. 'c') that failed to import and got added to the badmodules list, it will skip it entirely without even trying to import it.

This has a trivial fix (attached).  The right thing to do is clearly to check it by fqname in the badmodules dict since that's also what it expects in other locations.

I can make a PR as soon as my CLA gets validated, if that is more convenient.  (Which branch should I make the PR against?)
msg331366 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2018-12-07 23:37
PRs should always be against 'master' unless the issue is already fixed there.
Date User Action Args
2019-02-08 03:24:09brandtbuchersetpull_requests: + pull_request11785
2018-12-07 23:37:45brett.cannonsetnosy: - brett.cannon
2018-12-07 23:37:37brett.cannonsetnosy: + brett.cannon
messages: + msg331366
2018-12-07 23:36:50brett.cannonsetnosy: + jvr
2018-12-07 23:36:38brett.cannonsetnosy: - brett.cannon
2018-12-04 15:39:48rdbsetpull_requests: - pull_request10133
2018-12-04 15:37:38rdbsetpull_requests: + pull_request10134
2018-12-04 15:25:52rdbsetpull_requests: + pull_request10133
2018-12-02 15:45:17SilentGhostsetnosy: + brett.cannon, ncoghlan, eric.snow
stage: patch review

versions: - Python 3.4, Python 3.5
2018-12-02 15:00:55rdbcreate