summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
Commit message (Collapse)AuthorAgeFilesLines
* Fix typo in test_api.py. (GH-16119)Miss Islington (bot)2019-09-131-1/+1
| | | | | (cherry picked from commit 0bc17ea2f5966f429b5b8d6b4ccb9c01f1f610d0) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.8] bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. ↵Jason R. Coombs2019-09-102-11/+23
| | | | | | | | (GH-15840) (#15861) https://gitlab.com/python-devs/importlib_metadata/-/tags/0.21. (cherry picked from commit 17499d82702432955d8e442a1871ff276ca64bc5) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* bpo-38010 Sync importlib.metadata with importlib_metadata 0.20. (GH-15646) ↵Miss Islington (bot)2019-09-021-0/+2
| | | | | | | | (GH-15648) Sync importlib.metadata with importlib_metadata 0.20. (cherry picked from commit 102e9b40ff6ee45086a5f0d34d9c60c581a1e5e5) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* Fix typos mostly in comments, docs and test names (GH-15209)Miss Islington (bot)2019-08-303-3/+3
| | | | | (cherry picked from commit 39d87b54715197ca9dcb6902bb43461c0ed701a2) Co-authored-by: Min ho Kim <minho42@gmail.com>
* [3.8] bpo-37830: Fix compilation of break and continue in finally. ↵Serhiy Storchaka2019-08-241-1/+1
| | | | | | | | | (GH-15320) (GH-15456) Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value. (cherry picked from commit ef61c524ddeeb56da3858b86e349e7288d68178e)
* bpo-37697: Sync with importlib_metadata 0.19 (GH-14993) (GH-14995)Miss Islington (bot)2019-07-283-4/+24
| | | | | | | | | | * bpo-37697: Sync with importlib_metadata 0.19 * Run make regen-importlib * 📜🤖 Added by blurb_it. (cherry picked from commit 049460da9c7b5f51732e2966195c44713af9dc4c) Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* [3.8] Fix typos in docs, comments and test assert messages (GH-14872). (#14900)Kyle Stanley2019-07-221-1/+1
| | | | | (cherry picked from commit 96e12d5f4f3c5a20986566038ee763dff3c228a1) Co-authored-by: Min ho Kim <minho42@gmail.com>
* Remove unused imports in tests (GH-14518) (GH-14520)Victor Stinner2019-07-011-1/+0
| | | (cherry picked from commit 8f4ef3b019ce380022018587571b0f970e668de3)
* cross port importlib-metadata PR GH-76 (GH-13903)Miss Islington (bot)2019-06-073-0/+2
| | | | | | https://gitlab.com/python-devs/importlib_metadata/merge_requests/76 (cherry picked from commit 65e5860fcc8ffe66f3c325d5484112f3b6540e8c) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* Don't crash if there exists an EGG-INFO directory on sys.path (#13667)Anthony Sottile2019-05-301-0/+8
| | | | | | | | * 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-247-0/+564
| | | Add importlib.metadata module as forward port of the standalone importlib_metadata.
* bpo-36766: Typos in docs and code comments (GH-13116)penguindustin2019-05-061-1/+1
|
* bpo-36540: PEP 570 -- Implementation (GH-12701)Pablo Galindo2019-04-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-36680: Rename duplicate test_source_from_cache_path_like_arg function ↵Windson yang2019-04-221-1/+1
| | | | (GH-12893)
* bpo-35843: Implement __getitem__ for _NamespacePath (GH-11690)Anthony Sottile2019-03-081-0/+6
|
* bpo-35202: Remove unused imports in tests. (GH-10561)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-161-1/+0
|
* bpo-34022: Stop forcing of hash-based invalidation with SOURCE_DATE_EPOCH ↵Elvis Pranskevichus2018-10-101-0/+15
| | | | | | | | | | | | | | | | | | | | (GH-9607) Unconditional forcing of ``CHECKED_HASH`` invalidation was introduced in 3.7.0 in bpo-29708. The change is bad, as it unconditionally overrides *invalidation_mode*, even if it was passed as an explicit argument to ``py_compile.compile()`` or ``compileall``. An environment variable should *never* override an explicit argument to a library function. That change leads to multiple test failures if the ``SOURCE_DATE_EPOCH`` environment variable is set. This changes ``py_compile.compile()`` to only look at ``SOURCE_DATE_EPOCH`` if no explicit *invalidation_mode* was specified. I also made various relevant tests run with explicit control over the value of ``SOURCE_DATE_EPOCH``. While looking at this, I noticed that ``zipimport`` does not work with hash-based .pycs _at all_, though I left the fixes for subsequent commits.
* bpo-25711: Rewrite zipimport in pure Python. (GH-6809)Serhiy Storchaka2018-09-182-7/+7
|
* bpo-29514: Make magic number test work for candidatesNed Deily2018-06-271-1/+1
|
* bpo-33499: Add PYTHONPYCACHEPREFIX env var for alt bytecode cache location. ↵Carl Meyer2018-06-162-11/+95
| | | | | | | | | | | | | | | (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-33755: Fix importlib.resources isolation tests (#7412)Barry Warsaw2018-06-052-1/+9
|
* bpo-32374: Ignore Python-level exceptions in test_bad_traverse (GH-7145)Marcel Plch2018-05-281-7/+13
|
* bpo-33629: Prevent coredump in test_importlib (GH-7090)Victor Stinner2018-05-241-1/+4
| | | | | bpo-32374, bpo-33629: Use support.SuppressCrashReport() in test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent leaking a core dump file.
* bpo-33254: do not return an empty list when asking for the contents of a ↵Brett Cannon2018-04-301-4/+3
| | | | namespace package (GH-6467)
* bpo-33169: Remove values of `None` from sys.path_importer_cache when ↵Brett Cannon2018-04-062-1/+22
| | | | | 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-272-3/+32
|
* bpo-32374: m_traverse may be called with m_state=NULL (GH-5140)Marcel Plch2018-03-171-1/+15
| | | | | Multi-phase initialized modules allow m_traverse to be called while the module is still being initialized, so module authors may need to account for that.
* bpo-17611. Move unwinding of stack for "pseudo exceptions" from interpreter ↵Serhiy Storchaka2018-02-221-1/+1
| | | | | | | | | to compiler. (GH-5006) Co-authored-by: Mark Shannon <mark@hotpy.org> Co-authored-by: Antoine Pitrou <antoine@python.org>
* bpo-32303 - Consistency fixes for namespace loaders (#5481)Barry Warsaw2018-02-022-2/+20
| | | | | | | * Make sure ``__spec__.loader`` matches ``__loader__`` for namespace packages. * Make sure ``__spec__.origin` matches ``__file__`` for namespace packages. https://bugs.python.org/issue32303 https://bugs.python.org/issue32305
* bpo-32248: Fix test_importlib.test_open() (#5213)Victor Stinner2018-01-171-2/+2
| | | | Use the binary.file instead of utf-8.file to avoid issues with Unix newlines vs Windows newlines.
* Implement the get_resource_reader() API for file system imports (#5168)Barry Warsaw2018-01-152-1/+4
|
* bpo-32248 - Implement importlib.resources (#4911)Barry Warsaw2017-12-3024-0/+473
| | | | Port importlib_resources to importlib.resources
* bpo-32248: Implement importlib.abc.ResourceReader (GH-4892)Brett Cannon2017-12-161-0/+39
|
* bpo-32297: Few misspellings found in Python source code comments. (#4803)Mike2017-12-142-2/+2
| | | | | | | | * Fix multiple typos in code comments * Add spacing in comments (test_logging.py, test_math.py) * Fix spaces at the beginning of comments in test_logging.py
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-092-15/+197
| | | | | | | | | | | | | | | | | | | | | | | | | Python now supports checking bytecode cache up-to-dateness with a hash of the source contents rather than volatile source metadata. See the PEP for details. While a fairly straightforward idea, quite a lot of code had to be modified due to the pervasiveness of pyc implementation details in the codebase. Changes in this commit include: - The core changes to importlib to understand how to read, validate, and regenerate hash-based pycs. - Support for generating hash-based pycs in py_compile and compileall. - Modifications to our siphash implementation to support passing a custom key. We then expose it to importlib through _imp. - Updates to all places in the interpreter, standard library, and tests that manually generate or parse pyc files to grok the new format. - Support in the interpreter command line code for long options like --check-hash-based-pycs. - Tests and documentation for all of the above.
* bpo-21720: Restore the Python 2.7 logic in handling a fromlist. (#4118)Serhiy Storchaka2017-10-261-0/+43
| | | | | | BytesWarning no longer emitted when the fromlist argument of __import__() or the __all__ attribute of the module contain bytes instances.
* bpo-31642: Restore blocking "from" import by setting None in sys.modules. ↵Serhiy Storchaka2017-10-081-0/+14
| | | | (#3834)
* bpo-31370: Remove support for threads-less builds (#3385)Antoine Pitrou2017-09-071-122/+100
| | | | | | * Remove Setup.config * Always define WITH_THREAD for compatibility.
* Spelling fixes (#2902)Ville Skyttä2017-08-031-1/+1
|
* bpo-30876: Relative import from unloaded package now reimports the package ↵Serhiy Storchaka2017-07-121-1/+1
| | | | | | | | | (#2639) instead of failing with SystemError. Relative import from non-package now fails with ImportError rather than SystemError.
* bpo-30436: Raise ModuleNotFoundError for importlib.util.find_spec() when ↵Milan Oberkirch2017-06-141-0/+6
| | | | | parent isn't a package (GH-1899) Previously AttributeError was raised, but that's not very reflective of the fact that the requested module can't be found since the specified parent isn't actually a package.
* bpo-29851: Have importlib.reload() raise ImportError if the module's spec is ↵Garvit Khatri2017-05-241-2/+12
| | | | not found (GH-972)
* bpo-30158: Fix deprecation warnings in test_importlib introduced by ↵Serhiy Storchaka2017-04-291-13/+16
| | | | bpo-29576. (#1285)
* bpo-29514: Check magic number for bugfix release (#54)Eric Appelt2017-04-171-0/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-29514: Check magic number for micro release Add a dict importlib.util.EXPECTED_MAGIC_NUMBERS which details the initial and expected pyc magic number for each minor release. This gives a mechanism for users to check if the magic number has changed within a release and for a test to ensure procedure is followed if a change is necessary. Add a test to check the current MAGIC_NUMBER against the expected number for the release if the current release is at candidate or final level. On test failure, describe to the developer the procedure for changing the magic number. * Simplify magic number release test Simplify the magic number release test by removing EXPECTED_MAGIC_NUMBERS table and making the expected magic number self-contained within the test. BPO: 29514 * Improve magic number test execution and message Improve the execution of the magic number test by using skipUnless for alpha and beta releases, and directly inheriting from unittest.TestCase rather than using the machinery for the other tests. Also improve the error message to explain the reason for caution in changing the magic number. BPO: 29514
* bpo-29576: add explicit deprecation for importlib.abc.find_loader() and ↵Matthias Bussonnier2017-02-161-0/+6
| | | | | | find_module() (GH-32)
* Remove unused imports.Serhiy Storchaka2016-12-162-3/+0
|
* Issue #26940: Fix test_importlib that hangs on the Android armv7 qemu emulator.Xavier de Gaye2016-12-081-1/+1
|
* Issue #28026: Raise ImportError when exec_module() exists but ↵Eric Snow2016-09-081-7/+1
| | | | create_module() is missing.
* Issue #26667: Add path-like object support to importlib.util.Brett Cannon2016-09-082-0/+25
|
* Issue #15767: Use ModuleNotFoundError.Eric Snow2016-09-072-5/+9
|