Commit 5fbd6db6 authored by R David Murray's avatar R David Murray

whatsnew: tweak a couple importlib porting notes.

I had missed that there was already an entry for the Frozen package change, so
I combined mine with the existing one.  Also added the info about the reload
change to the entry for the other changes to reload, but I'm missing an issue
number for the rest of the attribute behavior changes so I left myself an
XXX as a reminder to find it.
parent 6ce4242c
......@@ -1883,10 +1883,15 @@ Changes in the Python API
* Import now resets relevant attributes (e.g. ``__name__``, ``__loader__``,
``__package__``, ``__file__``, ``__cached__``) unconditionally when reloading.
Note that this restores a pre-3.3 behavior in that it means a module is
re-found when re-loaded (:issue:`19413` and XXX).
* Frozen packages no longer set ``__path__`` to a list containing the package
name but an empty list instead. Determing if a module is a package should be
done using ``hasattr(module, '__path__')``.
name, they now set it to an empty list. The previous behavior could cause
the import system to do the wrong thing on submodule imports if there was
also a directory with the same name as the frozen package. The correct way
to determine if a module is a package or not is to use``hasattr(module,
'__path__')`` (:issue:`18065`).
* :func:`py_compile.compile` now raises :exc:`FileExistsError` if the file path
it would write to is a symlink or a non-regular file. This is to act as a
......@@ -1984,12 +1989,6 @@ Changes in the Python API
similarly to ``__kwdefaults__``. (Contributed by Yury Selivanov in
:issue:`20625`).
* Frozen packages used to have their ``__path__`` set to the package name,
but this could cause the import system to do the wrong thing on submodule
imports if there was also a directory with the same name as the frozen
package. The ``__path__`` for frozen packages is now set to ``[]``
(:issue:`18065`).
* :attr:`hashlib.hash.name` now always returns the identifier in lower case.
Previously some builtin hashes had uppercase names, but now that it is a
formal public interface the naming has been made consistent (:issue:`18532`).
......
......@@ -1463,7 +1463,7 @@ Tests
- Issue #19085: Added basic tests for all tkinter widget options.
- Issue 19384: Fix test_py_compile for root user, patch by Claudiu Popa.
- Issue #19384: Fix test_py_compile for root user, patch by Claudiu Popa.
Documentation
-------------
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment