summaryrefslogtreecommitdiff
path: root/Lib/importlib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-40443: Remove unused imports in stdlib (GH-19815)Victor Stinner2020-05-011-2/+1
|
* bpo-40050: Fix importlib._bootstrap_external (GH-19135)Victor Stinner2020-03-241-21/+13
| | | | | | Remove two unused imports: _thread and _weakref. Avoid creating a new winreg builtin module if it's already available in sys.modules. The winreg module is now stored as "winreg" rather than "_winreg".
* bpo-38691: importlib ignores PYTHONCASEOK if -E is used (GH-18627)idomic2020-03-091-2/+2
| | | | | The importlib module now ignores the PYTHONCASEOK environment variable when the -E or -I command line options are being used.
* bpo-38091: Import deadlock detection causes deadlock (GH-17518)Armin Rigo2020-03-021-0/+9
| | | Automerge-Triggered-By: @brettcannon
* Revert "bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags ↵Victor Stinner2020-02-191-1/+1
| | | | | passed (#18314)" (GH-18553) This reverts commit d83b6600b25487e4ebffd7949d0f478de9538875.
* bpo-38691 Added a switch to ignore PYTHONCASEOK when -E or -I flags passed ↵idomic2020-02-171-1/+1
| | | | | | | | | | | | | | | | | | | | | (#18314) * Hard reset + cherry piciking the changes. * 📜🤖 Added by blurb_it. * Added @vstinner News * Update Misc/NEWS.d/next/Library/2020-02-11-13-01-38.bpo-38691.oND8Sk.rst Co-Authored-By: Victor Stinner <vstinner@python.org> * Hard reset to master * Hard reset to master + latest changes Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-39595: Improve zipfile.Path performance (#18406)Jason R. Coombs2020-02-111-5/+7
| | | | | | | | | | | | | | | | | | * Improve zipfile.Path performance on zipfiles with a large number of entries. * 📜🤖 Added by blurb_it. * Add bpo to blurb * Sync with importlib_metadata 1.5 (6fe70ca) * Update blurb. * Remove compatibility code * Add stubs module, omitted from earlier commit Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39320: Handle unpacking of **values in compiler (GH-18141)Mark Shannon2020-01-271-1/+2
| | | | | | | | | | | | | * Add DICT_UPDATE and DICT_MERGE bytecodes. Use them for ** unpacking. * Remove BUILD_MAP_UNPACK and BUILD_MAP_UNPACK_WITH_CALL, as they are now unused. * Update magic number for ** unpacking opcodes. * Update dis.rst to incorporate new bytecodes. * Add blurb entry.
* bpo-39320: Handle unpacking of *values in compiler (GH-17984)Mark Shannon2020-01-231-1/+3
| | | | | | | | * Add three new bytecodes: LIST_TO_TUPLE, LIST_EXTEND, SET_UPDATE. Use them to implement star unpacking expressions. * Remove four bytecodes BUILD_LIST_UNPACK, BUILD_TUPLE_UNPACK, BUILD_SET_UNPACK and BUILD_TUPLE_UNPACK_WITH_CALL opcodes as they are now unused. * Update magic number and dis.rst for new bytecodes.
* bpo-39336: Allow packages to not let their child modules be set on them (#18006)Dino Viehland2020-01-221-1/+6
| | | | | * bpo-39336: Allow setattr to fail on modules which aren't assignable When attaching a child module to a package if the object in sys.modules raises an AttributeError (e.g. because it is immutable) it causes the whole import to fail. This now allows immutable packages to exist and an ImportWarning is reported and the AttributeError exception is ignored.
* bpo-39156: Break up COMPARE_OP into four logically distinct opcodes. (GH-17754)Mark Shannon2020-01-141-1/+2
| | | | | | | | Break up COMPARE_OP into four logically distinct opcodes: * COMPARE_OP for rich comparisons * IS_OP for 'is' and 'is not' tests * CONTAINS_OP for 'in' and 'is not' tests * JUMP_IF_NOT_EXC_MATCH for checking exceptions in 'try-except' statements.
* bpo-39297: Update for importlib_metadata 1.4. (GH-17947)Jason R. Coombs2020-01-111-36/+72
| | | | | | | | | | * bpo-39297: Update for importlib_metadata 1.4. Includes performance updates. * 📜🤖 Added by blurb_it. * Update blurb Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 (GH-17568)Jason R. Coombs2019-12-101-1/+22
| | | | | | | | * bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 including improved docs for custom finders and better serialization support in EntryPoints. * 📜🤖 Added by blurb_it. * Correct module reference
* Produce cleaner bytecode for 'with' and 'async with' by generating separate ↵Mark Shannon2019-11-211-1/+3
| | | | | | code for normal and exceptional paths. (#6641) Remove BEGIN_FINALLY, END_FINALLY, CALL_FINALLY and POP_FINALLY bytecodes. Implement finally blocks by code duplication. Reimplement frame.lineno setter using line numbers rather than bytecode offsets.
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-1/+1
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993)Jason R. Coombs2019-09-122-65/+78
| | | | | | * bpo-38121: Sync importlib.metadata with 0.22 backport * 📜🤖 Added by blurb_it.
* bpo-35923: Update the BuiltinImporter to use loader._ORIGIN instead of a ↵Dong-hee Na2019-09-111-2/+4
| | | | | | hard-coded value (GH-15651)
* bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)Jason R. Coombs2019-09-102-22/+59
| | | https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21
* bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646)Jason R. Coombs2019-09-021-3/+15
| | | Sync importlib.metadata with importlib_metadata 0.20.
* bpo-34880: Add the LOAD_ASSERTION_ERROR opcode. (GH-15073)Zackery Spytz2019-08-251-1/+2
| | | | Fix assert statement misbehavior if AssertionError is shadowed.
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-241-1/+2
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)Serhiy Storchaka2019-08-081-1/+1
| | | | They now return NotImplemented for unsupported type of the other operand.
* Make importlib.metadata a simple module (#15153)Barry Warsaw2019-08-061-0/+0
|
* bpo-37444: Update differing exception between builtins and importlib (GH-14869)Ngalim Siregar2019-08-022-3/+3
| | | | | | | | | | Imports now raise `TypeError` instead of `ValueError` for relative import failures. This makes things consistent between `builtins.__import__` and `importlib.__import__` as well as using a more natural import for the failure. https://bugs.python.org/issue37444 Automerge-Triggered-By: @brettcannon
* bpo-37697: Sync with importlib_metadata 0.19 (#14993)Jason R. Coombs2019-07-282-11/+20
| | | | | | | | * bpo-37697: Sync with importlib_metadata 0.19 * Run make regen-importlib * 📜🤖 Added by blurb_it.
* Fix typos in docs, comments and test assert messages (#14872)Min ho Kim2019-07-211-1/+1
|
* bpo-37593: Swap the positions of posonlyargs and args in the constructor of ↵Pablo Galindo2019-07-141-1/+3
| | | | | ast.parameters nodes (GH-14778) https://bugs.python.org/issue37593
* bpo-35224: Bump the pyc magic number by 1 instead of by 10 in last ↵Pablo Galindo2019-06-231-2/+2
| | | | modification (GH-14320)
* bpo-35224: Bump the pyc magic number after the change in MAP_ADD (GH-14313)Pablo Galindo2019-06-221-1/+3
|
* cross port importlib-metadata PR #76 (#13903)Anthony Sottile2019-06-071-0/+2
| | | https://gitlab.com/python-devs/importlib_metadata/merge_requests/76
* Don't crash if there exists an EGG-INFO directory on sys.path (#13667)Anthony Sottile2019-05-291-1/+2
| | | | | | | | * Don't crash if there exists an EGG-INFO directory on sys.path cross-port of https://gitlab.com/python-devs/importlib_metadata/merge_requests/72 * Also catch PermissionError for windows
* bpo-34632: Add importlib.metadata (GH-12547)Jason R. Coombs2019-05-242-0/+446
| | | Add importlib.metadata module as forward port of the standalone importlib_metadata.
* bpo-36842: Implement PEP 578 (GH-12613)Steve Dower2019-05-231-2/+6
| | | Adds sys.audit, sys.addaudithook, io.open_code, and associated C APIs.
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This commit contains the implementation of PEP570: Python positional-only parameters. * Update Grammar/Grammar with new typedarglist and varargslist * Regenerate grammar files * Update and regenerate AST related files * Update code object * Update marshal.c * Update compiler and symtable * Regenerate importlib files * Update callable objects * Implement positional-only args logic in ceval.c * Regenerate frozen data * Update standard library to account for positional-only args * Add test file for positional-only args * Update other test files to account for positional-only args * Add News entry * Update inspect module and related tests
* bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)Anthony Sottile2019-03-081-0/+3
|
* bpo-35887: Add make regen-importlib step to importlib._bootstrap docstring ↵Nina Zakharenko2019-02-131-3/+3
| | | | (GH-11777)
* bpo-35321: Set the spec origin to frozen in frozen modules (#11732)Nina Zakharenko2019-02-041-2/+4
| | | | | | | | | | * bpo-35321: Set the spec origin to frozen in frozen modules This fix correctly sets the spec origin to "frozen" for the _frozen_importlib module. Note that the origin was already correctly set in _frozen_importlib_external. * 📜🤖 Added by blurb_it.
* bpo-35133: Fix mistakes when concatenate string literals on different lines. ↵Serhiy Storchaka2018-11-051-1/+1
| | | | | | | | | | (GH-10284) Two kind of mistakes: 1. Missed space. After concatenating there is no space between words. 2. Missed comma. Causes unintentional concatenating in a list of strings.
* bpo-33331: Clean modules in the reversed order in PyImport_Cleanup(). (GH-6565)Serhiy Storchaka2018-10-291-56/+62
| | | | | | Modules imported last are now cleared first at interpreter shutdown. A newly imported module is moved to the end of sys.modules, behind modules on which it depends.
* bpo-35024: Remove redundant and possibly incorrect verbose message after ↵Quentin Agren2018-10-261-1/+0
| | | | | | | | | writing '.pyc' (GH-9998) Since `SourceFileLoader.set_data()` catches exceptions raised by `_write_atomic()` and logs an informative message consequently, always logging successful outcome in 'SourceLoader.get_code()' seems redundant. https://bugs.python.org/issue35024
* importlib: Fix typo in SourceLoader.path_stats docstring (GH-10052)Quentin2018-10-251-3/+4
|
* bpo-25711: Move _ZipImportResourceReader from importlib to zipimport. (GH-9406)Serhiy Storchaka2018-09-191-84/+0
|
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-182-12/+18
|
* bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. ↵Carl Meyer2018-06-161-10/+52
| | | | | | | | | | | | | | | (GH-6834) In some development setups it is inconvenient or impossible to write bytecode caches to the code tree, but the bytecode caches are still useful. The PYTHONPYCACHEPREFIX environment variable allows specifying an alternate location for cached bytecode files, within which a directory tree mirroring the code tree will be created. This cache tree is then used (for both reading and writing) instead of the local `__pycache__` subdirectory within each source directory. Exposed at runtime as sys.pycache_prefix (defaulting to None), and can be set from the CLI as "-X pycache_prefix=path". Patch by Carl Meyer.
* bpo-30436: Add missing space in importlib.util.find_spec() error message ↵Zackery Spytz2018-06-071-1/+1
| | | | (GH-7385)
* bpo-32911: Add the historical note about the magic number. (GH-7273)Serhiy Storchaka2018-05-311-0/+2
|
* bpo-33537: Add an __all__ to importlib.resources (#6920)Barry Warsaw2018-05-171-8/+20
|
* bpo-33254: do not return an empty list when asking for the contents of a ↵Brett Cannon2018-04-302-13/+12
| | | | namespace package (GH-6467)
* bpo-33169: Remove values of `None` from sys.path_importer_cache when ↵Brett Cannon2018-04-061-2/+4
| | | | | invalidating caches (GH-6402) An entry of None in sys.path_importer_cache represents a negative/missing finder for a path, so clearing it out makes sense.
* bpo-33151: Handle submodule resources (GH-6268)Barry Warsaw2018-03-271-3/+5
|