summaryrefslogtreecommitdiffstats
path: root/Lib/importlib
Commit message (Collapse)AuthorAgeFilesLines
* [3.11] gh-117178: Recover lazy loading of self-referential modules ↵Miss Islington (bot)2024-03-281-6/+5
| | | | | | (GH-117179) (#117320) Co-authored-by: Chris Markiewicz <effigies@gmail.com>
* [3.11] gh-116811: Ensure MetadataPathFinder.invalidate_caches is reachable ↵Jason R. Coombs2024-03-152-0/+4
| | | | | | | | | | when delegated through PathFinder. (GH-116812) (#116865) * Make MetadataPathFinder a proper classmethod. * In PathFinder.invalidate_caches, also invoke MetadataPathFinder.invalidate_caches. * Add blurb (cherry picked from commit 5f52d20a93908196f74271db8437cc1ba7e1e262)
* [3.11] gh-114763: Protect lazy loading modules from attribute access races ↵Miss Islington (bot)2024-02-261-30/+51
| | | | | | | | | | (GH-114781) (GH-115871) gh-114763: Protect lazy loading modules from attribute access races (GH-114781) Setting the __class__ attribute of a lazy-loading module to ModuleType enables other threads to attempt to access attributes before the loading is complete. Now that is protected by a lock. (cherry picked from commit 200271c61db44d90759f8a8934949aefd72d5724) Co-authored-by: Chris Markiewicz <effigies@gmail.com>
* [3.11] Add missed `stream` argument (GH-111775) (#115717)Miss Islington (bot)2024-02-201-1/+1
| | | | | | | | | | Add missed `stream` argument (GH-111775) * Add missed `stream` argument * Add news (cherry picked from commit 1ff6c1416b0bb422f4847cd84fcb33662a2497ef) Co-authored-by: Alexander Shadchin <shadchin@yandex-team.com>
* [3.11] GH-102700: allow built-in modules to be submodules (GH-103162) ↵Miss Islington (bot)2023-04-061-2/+0
| | | | | | | | (GH-103322) GH-102700: allow built-in modules to be submodules (GH-103162) (cherry picked from commit 5d08c3ff7d89ca11556f18663a372f6c12435504) Co-authored-by: Brett Cannon <brett@python.org>
* [3.11] gh-98706: Sync with importlib_metadata 4.13.0. (GH-98875)Jason R. Coombs2022-11-051-14/+38
| | | These changes are already applied to main but have been selected from importlib_metadata 4.x for their bug fixes.
* gh-91181: drop support for bytes on sys.path (GH-31934)Miss Islington (bot)2022-07-171-1/+1
| | | | | | | | | Support for bytes broke sometime between Python 3.2 and 3.6 and has been broken ever since. Trying to bring back supports is surprisingly difficult in the face of -b and checking for keys in sys.path_importer_cache. Since the support was broken for so long, trying to overcome the difficulty of bringing back the support has been deemed not worth it. Co-authored-by: Eryk Sun <eryksun@gmail.com> Co-authored-by: Brett Cannon <brett@python.org> (cherry picked from commit 6da988a46c8955755624ad9878288d5214fceb4e) Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* [3.11] gh-94485: Set line number of module's RESUME instruction to 0 as ↵Łukasz Langa2022-07-051-2/+3
| | | | | | | | | specified by PEP 626 (GH-94552) (GH-94562) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Mark Shannon <mark@hotpy.org> (cherry picked from commit 324d01944d16868b07df9e8eef6987766a31a36d)
* gh-93353: Fix importlib.resources._tempfile() finalizer (GH-93377)Miss Islington (bot)2022-06-131-2/+5
| | | | | | | | 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>
* gh-93461: Invalidate sys.path_importer_cache entries with relative paths ↵Miss Islington (bot)2022-06-131-4/+9
| | | | | | | (GH-93653) (cherry picked from commit 09243b898a13f3f61e275c1031143d1225e70916) Co-authored-by: Christian Heimes <christian@python.org>
* gh-91869: Fix tracing of specialized instructions with extended args (GH-91945)Dennis Sweeney2022-04-281-1/+1
|
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-211-1/+1
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* gh-91298: Refine traversable (apply changes from importlib_resources 5.7.1) ↵Jason R. Coombs2022-04-172-15/+39
| | | | | | | (#91623) * bpo-47142: Refine traversable (apply changes from importlib_resources 5.7.1) * Replace changelog referencing github issue.
* gh-91276: Make JUMP_IF_TRUE_OR_POP/JUMP_IF_FALSE_OR_POP relative (GH-32215)Irit Katriel2022-04-151-1/+3
|
* bpo-47120: make POP_JUMP_IF_TRUE/FALSE/NONE/NOT_NONE relative (GH-32400)Irit Katriel2022-04-111-1/+2
|
* bpo-47120: make JUMP_NO_INTERRUPT relative (GH-32221)Irit Katriel2022-04-051-1/+2
|
* bpo-47186: Replace JUMP_IF_NOT_EG_MATCH by CHECK_EG_MATCH + jump (GH-32309)Irit Katriel2022-04-051-1/+2
|
* bpo-47186: Replace JUMP_IF_NOT_EXC_MATCH by CHECK_EXC_MATCH + jump (GH-32231)Irit Katriel2022-04-011-1/+2
|
* bpo-47120: Replace the JUMP_ABSOLUTE opcode by the relative JUMP_BACKWARD ↵Irit Katriel2022-03-311-1/+2
| | | | (GH-32115)
* Use low bit of LOAD_GLOBAL's oparg to indicate whether it should push an ↵Mark Shannon2022-03-171-1/+2
| | | | additional NULL. (GH-31933)
* bpo-47004: Sync with importlib_metadata 4.11.3. (#31854)Jason R. Coombs2022-03-131-18/+39
|
* bpo-46841: Don't use an oparg counter for `STORE_SUBSCR` (GH-31742)Brandt Bucher2022-03-081-1/+2
|
* bpo-46841: Use inline caching for calls (GH-31709)Brandt Bucher2022-03-071-1/+2
|
* Remove trailing spaces (GH-31695)Serhiy Storchaka2022-03-051-1/+1
|
* bpo-46841: Fix error message hacks in `GET_AWAITABLE` (GH-31664)Brandt Bucher2022-03-041-1/+2
|
* bpo-46841: Use inline caching for attribute accesses (GH-31640)Brandt Bucher2022-03-031-1/+3
|
* bpo-46841: Use inline cache for `BINARY_SUBSCR`. (GH-31618)Mark Shannon2022-03-011-1/+1
|
* bpo-46841: Use inline caching for `COMPARE_OP` (GH-31622)Brandt Bucher2022-03-011-1/+2
|
* bpo-46841: Move the cache for `LOAD_GLOBAL` inline. (GH-31575)Mark Shannon2022-02-281-2/+2
|
* bpo-46841: Use inline caching for `UNPACK_SEQUENCE` (GH-31591)Brandt Bucher2022-02-281-1/+2
|
* bpo-46841: Use *inline* caching for `BINARY_OP` (GH-31543)Brandt Bucher2022-02-251-4/+2
|
* bpo-46329: Streamline calling sequence a bit. (GH-31465)Mark Shannon2022-02-211-1/+2
| | | | | | | | | | | | | | * Move handling of bound-methods to PRECALL. * Remove call_shape.postcall_shrink * Remove call_shape.callable * Remove call_shape.callable. Change CALL oparg to match PRECALL oparg. * Move KW_NAMES before PRECALL. * Update opcode docs in dis.rst
* bpo-46329: Change calling sequence (again) (GH-31373)Mark Shannon2022-02-181-1/+2
| | | | * Change calling sequence: Add PUSH_NULL. Merge PRECALL_FUNCTION and PRECALL_METHOD into PRECALL.
* bpo-46246: add missing __slots__ to importlib.metadata.DeprecatedList (GH-30452)Arie Bovenberg2022-02-111-0/+2
| | | | | | | 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
* bpo-46329: Split calls into precall and call instructions. (GH-30855)Mark Shannon2022-01-281-1/+6
| | | | | | | | | | | | | | * Add PRECALL_FUNCTION opcode. * Move 'call shape' varaibles into struct. * Replace CALL_NO_KW and CALL_KW with KW_NAMES and CALL instructions. * Specialize for builtin methods taking using the METH_FASTCALL | METH_KEYWORDS protocol. * Allow kwnames for specialized calls to builtin types. * Specialize calls to tuple(arg) and str(arg).
* bpo-46528: Simplify the VM's stack manipulations (GH-30902)Brandt Bucher2022-01-261-1/+3
|
* bpo-43683: Streamline YIELD_VALUE and SEND (GH-30723)Mark Shannon2022-01-241-1/+2
| | | | | | | | * Split YIELD_VALUE into ASYNC_GEN_WRAP; YIELD_VALUE for async generators. * Split SEND into SEND; YIELD_VALUE. * Document new opcodes.
* bpo-46474: Avoid REDoS in EntryPoint.pattern (sync with importlib_metadata ↵Jason R. Coombs2022-01-231-2/+2
| | | | 4.10.1) (GH-30803)
* bpo-46474: Apply changes from importlib_metadata 4.10.0 (GH-30802)Jason R. Coombs2022-01-231-12/+0
|
* bpo-46409: Make generators in bytecode (GH-30633)Mark Shannon2022-01-201-1/+2
| | | | | | | | | | | | * Add RETURN_GENERATOR and JUMP_NO_INTERRUPT opcodes. * Trim frame and generator by word each. * Minor refactor of frame.c * Update test.test_sys to account for smaller frames. * Treat generator functions as normal functions when evaluating and specializing.
* bpo-45923: Handle call events in bytecode (GH-30364)Mark Shannon2022-01-061-1/+6
| | | | * Add a RESUME instruction to handle "call" events.
* bpo-46031: add POP_JUMP_IF_NOT_NONE and POP_JUMP_IF_NONE (GH-30019)penguin_wwy2022-01-061-1/+2
|
* bpo-46009: Remove GEN_START (GH-30367)Brandt Bucher2022-01-041-1/+2
|
* bpo-46202: Remove opcode POP_EXCEPT_AND_RERAISE (GH-30302)Irit Katriel2022-01-041-1/+2
| | | | | | * bpo-46202: remove opcode POP_EXCEPT_AND_RERAISE * do not assume that an exception group is truthy
* bpo-46219, 46221: simplify except* implementation following exc_info ↵Irit Katriel2022-01-021-1/+2
| | | | changes. Move helpers to exceptions.c. Do not assume that exception groups are truthy. (GH-30289)
* bpo-46118: Move importlib.resources to its own package. (#30176)Jason R. Coombs2021-12-3111-367/+407
| | | | | * bpo-46118: Move importlib.resources to its own package. * Expand compatibility shims with documentation and explicit imports.
* bpo-46125: Refactor tests to test traversable API directly. Includes changes ↵Jason R. Coombs2021-12-194-24/+23
| | | | from importlib_resources 5.4.0. (GH-30189)
* bpo-45711: Remove type and traceback from exc_info (GH-30122)Irit Katriel2021-12-171-2/+3
| | | | | | | | * Do not PUSH/POP traceback or type to the stack as part of exc_info * Remove exc_traceback and exc_type from _PyErr_StackItem * Add to what's new, because this change breaks things like Cython
* bpo-44893: Implement EntryPoint as simple class with attributes. (GH-30150)Jason R. Coombs2021-12-165-66/+176
| | | | | * bpo-44893: Implement EntryPoint as simple class and deprecate tuple access in favor of attribute access. Syncs with importlib_metadata 4.8.1. * Apply refactorings found in importlib_metadata 4.8.2.
* bpo-46105: Honor spec when generating requirement specs with urls and ↵Jason R. Coombs2021-12-161-2/+11
| | | | extras. (GH-30151)