| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
| |
Fix the importlib.resources.as_file() context manager to remove the
temporary file if destroyed late during Python finalization: keep a
local reference to the os.remove() function. Patch by Victor Stinner.
(cherry picked from commit 443ca731d6b1267fe2f92985e0490460c95e44a8)
Co-authored-by: Victor Stinner <vstinner@python.org>
|
|
|
|
|
| |
(cherry picked from commit b1e286860742e7ba6fadc75e3ddb6c2899a56919)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
|
|
|
|
| |
Confirmed with @jaraco that this indeed needs a fix.
A question that came up while I was digging into the code: I think `SelectableGroups` could similarly use `__slots__ = ()`, since its purpose seems only for convenience around `dict`, not to have attributes of its own.
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit dd76b3f7d332dd6eced5cbc2ad2adfc397700b3d)
Co-authored-by: Arie Bovenberg <a.c.bovenberg@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
| |
importlib_metadata 4.10.1) (GH-30803) (GH-30827)
(cherry picked from commit 51c3e28c8a163e58dc753765e3cc51d5a717e70d)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
|
| |
extras. (GH-30151)
(cherry picked from commit 109d96602199a91e94eb14b8cb3720841f22ded7)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
|
| |
(cherry picked from commit 6ec0dec7b7b50d4fee5b2b66cf38e4291bcdf44c)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
| |
|
|
|
|
|
|
|
|
|
|
| |
(GH-28312) (GH-28321)
importlib.find_loader should also be slated for 3.12 like the others in GH-25169 and as documented in https://docs.python.org/3.11/whatsnew/3.10.htmlGH-deprecated.
(cherry picked from commit 9f93018b69d72cb48d3444554261ae3b0ea00c93)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-26807) (GH-26929)
Sync with importlib_metadata 4.6.
(cherry picked from commit efe7d08d178a7c09bcca994f2068b019c8633d83)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* [bpo-44246](): Entry points performance improvements.
From importlib_metadata 4.3.1.
* [bpo-44246](): Sync with importlib_metadata 4.4
(cherry picked from commit c34ed08d975fb7daa7b329f7c631647782290393)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Automerge-Triggered-By: GH:jaraco
|
|
|
|
|
|
| |
From importlib_metadata 4.3.1.
(cherry picked from commit 410b70d39d9d77384f8b8597560f6731530149ca)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
|
|
|
|
| |
(GH-26382) (GH-26395)
(cherry picked from commit 06ac3a4742228b0230981720060248a7425b2486)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Automerge-Triggered-By: GH:jaraco
|
|
|
|
|
|
|
|
|
|
| |
5.0.6). (GH-26387) (#26389)
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit f6fbdb90ee450ad693f7a7809035d0dc968f98b7)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
| |
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit e6c815d2e34be5fdf6dbe773f0781691746d2289)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
|
|
|
|
|
|
|
|
| |
Signed-off-by: Filipe Laíns <lains@riseup.net>
Automerge-Triggered-By: GH:jaraco
(cherry picked from commit df7eeacd83f531dd67cec7bc483dec6dce17ddbd)
Co-authored-by: Filipe Laíns <lains@riseup.net>
|
|
|
|
|
|
|
|
|
|
|
|
| |
(GH-26284) (GH-26286)
* [bpo-43643](): Sync with python/importlib_resources@c17a610aad.
* Sync with python/importlib_resources@89fd5e961a.
(cherry picked from commit 875b3d84b3072b2d3c352ad9f0ff52c441fbd12e)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Automerge-Triggered-By: GH:jaraco
|
|
|
|
|
|
|
|
|
| |
* bpo-43926: Cleaner metadata with PEP 566 JSON support.
* Add blurb
* Add versionchanged and versionadded declarations for changes to metadata.
* Use descriptor for PEP 566
|
| |
|
|
|
|
|
| |
* Add length parameter to PyLineTable_InitAddressRange and doen't use sentinel values at end of table. Makes the line number table more robust.
* Update PyCodeAddressRange to match PEP 626.
|
|
|
|
|
|
|
| |
* bpo-43780: Sync with importlib_metadata 3.10.
* Add blurb
* Apply changes from importlib_metadata 3.10.1.
|
|
|
|
|
|
| |
(GH-25490)
This reverts commits 044a1048ca93d466965afc027b91a5a9eb9ce23c and 1be456ae9d53bb1cba2b24fc86175c282d1c2169, adapting the code to changes that happened after it.
|
| |
|
|
|
|
| |
objects from file locations (GH-25121)
|
| |
|
|
|
|
| |
(GH-25169)
|
|
|
|
|
|
| |
* Handle check for sending None to starting generator and coroutine into bytecode.
* Document new bytecode and make it fail gracefully if mis-compiled.
|
|
|
|
|
|
|
| |
* Update magic numbers and bootstrapping for GH-25069
* add blurb
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
|
|
|
|
| |
will be removed in Python 3.12 (GH-25167)
|
| |
|
|
|
|
|
|
|
| |
internally. (GH-25069)
* Use instruction offset, rather than bytecode offset. Streamlines interpreter dispatch a bit, and removes most EXTENDED_ARGs for jumps.
* Change some uses of PyCode_Addr2Line to PyFrame_GetLineNumber
|
|
|
|
| |
system (GH-25044)
|
| |
|
|
|
|
|
| |
(GH-24953)
This is to work towards the removal of the use of module_repr() in Python 3.12 (documented as deprecated since 3.4).
|
|
|
|
|
|
|
| |
* bpo-43428: Sync with importlib_metadata 3.7.3 (16ac3a95)
* Add 'versionadded' for importlib.metadata.packages_distributions
* Add section in what's new for Python 3.10 highlighting most salient changes and relevant backport.
|
|
|
|
|
|
|
| |
* bpo-43428: Sync with importlib_metadata 3.7.2 (67234b6)
* Add blurb
* Reformat blurb to create separate paragraphs for each change included.
|
|
|
|
|
| |
* Unify behavior in ResourceReaderDefaultsTests and align with the behavior found in importlib_resources.
* Equip NamespaceLoader with a NamespaceReader.
* Apply changes from importlib_resources 5.0.4
|
|
|
|
|
| |
Co-authored-by: Guido van Rossum <guido@python.org>
Co-authored-by: Talin <viridia@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#23758)
* bpo-42382: In importlib.metadata, `EntryPoint` objects now expose a `.dist` object referencing the `Distribution` when constructed from a `Distribution`.
Also, sync importlib_metadata 3.3:
- Add support for package discovery under package normalization rules.
- The object returned by `metadata()` now has a formally-defined protocol called `PackageMetadata` with declared support for the `.get_all()` method.
* Add blurb
* Remove latent footnote.
|
|
|
|
|
|
|
|
|
| |
after raising or reraising an exception (GH-23803)
* Ensure that f_lasti is set correctly after an exception is raised to conform to PEP 626.
* Update importlib
* Add NEWS.
|
|
|
| |
Raise an ImportWarning when the import system falls back on load_module(). As for implementations of load_module(), raise a DeprecationWarning.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Reduce memory footprint and improve performance of loading modules having many func annotations.
>>> sys.getsizeof({"a":"int","b":"int","return":"int"})
232
>>> sys.getsizeof(("a","int","b","int","return","int"))
88
The tuple is converted into dict on the fly when `func.__annotations__` is accessed first.
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Use @staticmethod on methods using @classmethod but don't use their
cls parameter on the following classes:
* BuiltinImporter
* FrozenImporter
* WindowsRegistryFinder
* PathFinder
Leave methods using @_requires_builtin or @_requires_frozen unchanged,
since this decorator requires the wrapped method to have an extra parameter
(cls or self).
|
|
|
|
|
|
|
| |
Simplify the importlib external bootstrap code:
importlib._bootstrap_external now uses regular imports to import
builtin modules. When it is imported, the builtin __import__()
function is already fully working and so can be used to import
builtin modules like sys.
|
|
|
| |
Remove unused imports and unused local variables.
|
| |
|
|
|
|
|
|
|
|
|
| |
* bpo-41490: ``path`` method to aggressively close handles
* Add blurb
* In ZipReader.contents, eagerly evaluate the contents to release references to the zipfile.
* Instead use _ensure_sequence to ensure any iterable from a reader is eagerly converted to a list if it's not already a sequence.
|
|
|
|
|
| |
~~The only differences are in the test files.~~
Automerge-Triggered-By: @jaraco
|
| |
|