[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Brett Cannon  added the comment:

All done in 3.7 and master.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset a09bb87c1eebb07b01b8105cf536704893aec565 by Brett Cannon in 
branch '3.7':
[3.7] bpo-33169: Remove values of `None` from sys.path_importer_cache when 
invalidating caches (GH-6402) (GH-6403)
https://github.com/python/cpython/commit/a09bb87c1eebb07b01b8105cf536704893aec565


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Change by Brett Cannon :


--
pull_requests: +6108

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Brett Cannon  added the comment:


New changeset 9e2be60634914f23db2ae5624e4acc9335bf5fea by Brett Cannon in 
branch 'master':
bpo-33169: Remove values of `None` from sys.path_importer_cache when 
invalidating caches (GH-6402)
https://github.com/python/cpython/commit/9e2be60634914f23db2ae5624e4acc9335bf5fea


--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-04-06 Thread Brett Cannon

Change by Brett Cannon :


--
keywords: +patch
pull_requests: +6107
stage:  -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-31 Thread Brett Cannon

Brett Cannon  added the comment:

OK, I will update importlib.machinery.PathFinder.invalidate_caches() to also 
drop None from sys.path_importer_cache (objects that are not None and do not 
define invalidate_caches() will be left alone just like they are today). I 
should hopefully be able to get to this before b4.

--
assignee:  -> brett.cannon
versions: +Python 3.7

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-30 Thread Guido van Rossum

Guido van Rossum  added the comment:

SGTM.

On Fri, Mar 30, 2018, 06:41 Ned Deily  wrote:

>
> Ned Deily  added the comment:
>
> The current behavior is causing problems for at least some use cases so it
> does seems to be closer to a bug than a feature.  If there is agreement
> that it is desirable to make the change, I think it's better to do it now
> in 3.7 than later.
>
> --
>
> ___
> Python tracker 
> 
> ___
>

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-30 Thread Ned Deily

Ned Deily  added the comment:

The current behavior is causing problems for at least some use cases so it does 
seems to be closer to a bug than a feature.  If there is agreement that it is 
desirable to make the change, I think it's better to do it now in 3.7 than 
later.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-29 Thread Nick Coghlan

Nick Coghlan  added the comment:

I agree that we can't change 3.6 at this late stage, but the change is 
borderline enough on the "new feature"/"bug fix" scale that I think it's worth 
asking Ned if he's comfortable with us changing it for 3.7.0b4.

Ned: the change we'd like to make is to update PathFinder.invalidate_caches to 
delete all entries in sys.path_importer_cache that have a value of None.

--
nosy: +ned.deily

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-29 Thread Brett Cannon

Brett Cannon  added the comment:

Correct because as documented it calls invalidate_caches() on meta-path finders 
and the one that handles sys.path calls invalidate_caches() on the finders 
found in sys.path_importer_cache() (as documented by 
https://docs.python.org/3/library/importlib.html#importlib.machinery.PathFinder.invalidate_caches).
 Since None isn't a finder it doesn't do anything there as there is no method 
to call. So the "full of lies" comment by the OP on the mypy repo is 
over-the-top/incorrect.

Now tweaking 
https://github.com/python/cpython/blob/521995205a2cb6b504fe0e39af22a81f785350a3/Lib/importlib/_bootstrap_external.py#L1180-L1186
 to delete entries in sys.path_importer_cache() that are set to None is 
straight-forward, but I don't think we can backport since it would be going 
against what the documentation says it does.

--
versions: +Python 3.8 -Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-29 Thread Brett Cannon

Change by Brett Cannon :


--
nosy: +brett.cannon, eric.snow, ncoghlan

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue33169] importlib.invalidate_caches() doesn't clear all caches

2018-03-28 Thread Guido van Rossum

New submission from Guido van Rossum :

See https://github.com/python/mypy/pull/4811. To summarize, 
importlib.invalidate_caches() doesn't clear the negative cache in 
sys.path_importer_cache.

Could be related to https://bugs.python.org/issue30891?

--
messages: 314595
nosy: gvanrossum
priority: normal
severity: normal
status: open
title: importlib.invalidate_caches() doesn't clear all caches
versions: Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com