cpython/Lib
Petr Viktorin 5c39e474db
[3.10] bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_cache (GH-29384) (GH-30922)
Consider the following directory structure:

    .
    └── PATH1
        └── namespace
            └── sub1
                └── __init__.py

And both PATH1 and PATH2 in sys path:

    $ PYTHONPATH=PATH1:PATH2 python3.11
    >>> import namespace
    >>> import namespace.sub1
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> ...

While this interpreter still runs, PATH2/namespace/sub2 is created:

    .
    ├── PATH1
    │   └── namespace
    │       └── sub1
    │           └── __init__.py
    └── PATH2
        └── namespace
            └── sub2
                └── __init__.py

The newly created module cannot be imported:

    >>> ...
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    Traceback (most recent call last):
      File "<stdin>", line 1, in <module>
    ModuleNotFoundError: No module named 'namespace.sub2'

Calling importlib.invalidate_caches() now newly allows to import it:

    >>> import importlib
    >>> importlib.invalidate_caches()
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace'])
    >>> import namespace.sub2
    >>> namespace.__path__
    _NamespacePath(['.../PATH1/namespace', '.../PATH2/namespace'])

This was not previously possible.
2022-01-27 06:00:23 -08:00
..
asyncio [3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (#30784) 2022-01-22 14:28:51 +02:00
collections
concurrent bpo-20369: concurrent.futures.wait() now deduplicates futures given a… (GH-30168) 2022-01-04 06:27:13 -08:00
ctypes bpo-45878: convert try/except to self.assertRaises in Lib/ctypes/test/test_functions.py (GH-29721) (GH-29748) 2021-12-24 11:28:57 +02:00
curses
dbm
distutils
email
encodings
ensurepip
html
http
idlelib bpo-46496: news11-10 for bpo45296 (GH-30937) 2022-01-26 23:05:42 -05:00
importlib [3.10] bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_cache (GH-29384) (GH-30922) 2022-01-27 06:00:23 -08:00
json bpo-46001: Change OverflowError to RecursionError in JSON library docstrings (GH-29943) 2021-12-07 02:20:10 -08:00
lib2to3
logging [3.10] bpo-42378: fixed log truncation on logging shutdown (GH-27310) (GH-30468) 2022-01-07 22:15:25 +00:00
msilib
multiprocessing
pydoc_data Python 3.10.2 2022-01-13 18:52:14 +00:00
site-packages
sqlite3 bpo-45677: Reword first section of sqlite3 docs (GH-29326) (GH-29566) 2021-11-15 15:31:38 -08:00
test [3.10] bpo-45703: Invalidate _NamespacePath cache on importlib.invalidate_cache (GH-29384) (GH-30922) 2022-01-27 06:00:23 -08:00
tkinter bpo-45496: Allow flexibility in winfo_rgb tests (GH-30185) 2021-12-26 04:04:26 -08:00
turtledemo
unittest bpo-41403: Improve error message for invalid mock target (GH-30833) (GH-30834) 2022-01-23 19:34:43 +00:00
urllib
venv [3.10] bpo-43749: Ensure current exe is copied when using venv on windows (GH-25216) (GH-30034) 2021-12-10 17:51:42 +00:00
wsgiref
xml
xmlrpc
zoneinfo
__future__.py
__phello__.foo.py
_aix_support.py
_bootsubprocess.py
_collections_abc.py bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518) 2022-01-27 05:01:24 -08:00
_compat_pickle.py
_compression.py
_markupbase.py
_osx_support.py
_py_abc.py
_pydecimal.py
_pyio.py
_sitebuiltins.py
_strptime.py
_threading_local.py
_weakrefset.py
abc.py
aifc.py
antigravity.py
argparse.py bpo-46080: fix argparse help generation exception in edge case (GH-30111) 2022-01-20 15:13:17 -08:00
ast.py
asynchat.py
asyncore.py
base64.py
bdb.py
binhex.py
bisect.py
bz2.py
calendar.py bpo-46266: Add calendar day of week constants to __all__ (GH-30412) (GH-30424) 2022-01-23 02:00:11 +01:00
cgi.py
cgitb.py
chunk.py
cmd.py
code.py
codecs.py
codeop.py
colorsys.py
compileall.py
configparser.py
contextlib.py
contextvars.py
copy.py bpo-45752: Remove "array" from list of things that cannot be copied in copy module docstring (GH-29555) 2021-11-14 05:18:31 -08:00
copyreg.py
cProfile.py
crypt.py
csv.py
dataclasses.py bpo-45663: Fix is_dataclass() for dataclasses which are subclasses of types.GenericAlias (GH-29294) 2021-12-05 13:04:29 -08:00
datetime.py
decimal.py
difflib.py
dis.py [3.10] bpo-45757: Fix bug where dis produced an incorrect oparg on EXTENDED_ARG before a no-arg opcode (GH-29480) (GH-29506) 2021-11-09 22:05:30 +00:00
doctest.py bpo-44904: Fix classmethod property bug in doctest module (GH-28838) 2021-10-28 01:09:41 -07:00
enum.py
filecmp.py
fileinput.py
fnmatch.py
fractions.py
ftplib.py
functools.py [3.10] bpo-46032: Check types in singledispatch's register() at declaration time (GH-30050) (GH-30254) 2021-12-25 16:12:32 +02:00
genericpath.py
getopt.py
getpass.py
gettext.py
glob.py
graphlib.py
gzip.py
hashlib.py
heapq.py
hmac.py
imaplib.py
imghdr.py
imp.py
inspect.py bpo-43118: Fix bug in inspect.signature around 'base.__text_signature__' (GH-30285) (#30765) 2022-01-22 09:28:48 -08:00
io.py
ipaddress.py
keyword.py
linecache.py
locale.py
lzma.py
mailbox.py
mailcap.py
mimetypes.py
modulefinder.py
netrc.py
nntplib.py
ntpath.py
nturl2path.py
numbers.py
opcode.py
operator.py
optparse.py
os.py
pathlib.py
pdb.py bpo-46434: Handle missing docstrings in pdb help (GH-30705) 2022-01-21 11:32:43 -08:00
pickle.py
pickletools.py
pipes.py
pkgutil.py
platform.py
plistlib.py
poplib.py
posixpath.py
pprint.py
profile.py
pstats.py
pty.py
py_compile.py
pyclbr.py
pydoc.py
queue.py
quopri.py
random.py
re.py
reprlib.py
rlcompleter.py
runpy.py
sched.py
secrets.py
selectors.py
shelve.py
shlex.py
shutil.py
signal.py [3.10] bpo-27718: Fix help for the signal module (GH-30063) (GH-30080) 2021-12-13 12:14:51 +02:00
site.py
smtpd.py
smtplib.py
sndhdr.py
socket.py
socketserver.py
sre_compile.py
sre_constants.py
sre_parse.py
ssl.py
stat.py
statistics.py Fix double-space in exception message (GH-29955) 2021-12-08 03:07:27 -08:00
string.py
stringprep.py
struct.py
subprocess.py
sunau.py
symtable.py
sysconfig.py
tabnanny.py
tarfile.py bpo-21987: Fix TarFile.getmember getting a dir with a trailing slash (GH-30283) 2022-01-21 00:05:57 -08:00
telnetlib.py
tempfile.py
textwrap.py
this.py
threading.py
timeit.py
token.py
tokenize.py
trace.py
traceback.py bpo-45614: Fix traceback display for exceptions with invalid module name (GH-29726) (GH-29826) 2021-11-29 10:07:24 +00:00
tracemalloc.py
tty.py
turtle.py bpo-45837: Note tiltangle is not deprecated, it's really settiltangle (GH-29629) 2021-11-19 19:55:40 +01:00
types.py bpo-45664: Fix resolve_bases() and new_class() for GenericAlias instance as a base (GH-29298) 2021-12-05 13:26:37 -08:00
typing.py bpo-44791: Fix substitution of ParamSpec in Concatenate with different parameter expressions (GH-27518) 2022-01-27 05:01:24 -08:00
uu.py
uuid.py
warnings.py
wave.py
weakref.py
webbrowser.py
xdrlib.py
zipapp.py
zipfile.py
zipimport.py