summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_importlib
Commit message (Collapse)AuthorAgeFilesLines
* bpo-39022, bpo-38594: Sync with importlib_metadata 1.3 (GH-17568)Jason R. Coombs2019-12-111-0/+33
| | | | | | | | * 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
* bpo-38839: Fix some unused functions in tests (GH-17189)Adam Johnson2019-11-191-0/+1
|
* Fix typo in test_api.py. (GH-16119)Benjamin Peterson2019-09-131-1/+1
|
* bpo-38086: Sync importlib.metadata with importlib_metadata 0.21. (GH-15840)Jason R. Coombs2019-09-102-11/+23
| | | 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-0/+2
| | | Sync importlib.metadata with importlib_metadata 0.20.
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-303-3/+3
|
* bpo-37830: Fix compilation of break and continue in finally. (GH-15320)Serhiy Storchaka2019-08-241-1/+1
| | | | | | Fix compilation of "break" and "continue" in the "finally" block when the corresponding "try" block contains "return" with a non-constant value.
* Unmark files as executable that can't actually be executed. (GH-15353)Greg Price2019-08-211-0/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | There are plenty of legitimate scripts in the tree that begin with a `#!`, but also a few that seem to be marked executable by mistake. Found them with this command -- it gets executable files known to Git, filters to the ones that don't start with a `#!`, and then unmarks them as executable: $ git ls-files --stage \ | perl -lane 'print $F[3] if (!/^100644/)' \ | while read f; do head -c2 "$f" | grep -qxF '#!' \ || chmod a-x "$f"; \ done Looking at the list by hand confirms that we didn't sweep up any files that should have the executable bit after all. In particular * The `.psd` files are images from Photoshop. * The `.bat` files sure look like things that can be run. But we have lots of other `.bat` files, and they don't have this bit set, so it must not be needed for them. Automerge-Triggered-By: @benjaminp
* bpo-37444: Update differing exception between builtins and importlib (GH-14869)Ngalim Siregar2019-08-032-5/+5
| | | | | | | | | | 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
* Fix typos in comments, docs and test names (#15018)Min ho Kim2019-07-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | * Fix typos in comments, docs and test names * Update test_pyparse.py account for change in string length * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: splitable -> splittable Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Apply suggestion: Dealloccte -> Deallocate Co-Authored-By: Terry Jan Reedy <tjreedy@udel.edu> * Update posixmodule checksum. * Reverse idlelib changes.
* bpo-37697: Sync with importlib_metadata 0.19 (#14993)Jason R. Coombs2019-07-283-4/+24
| | | | | | | | * 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-19696: Move threaded_import_hangers (GH-14655)Kyle Stanley2019-07-122-3/+48
| | | | | | | | | Move `threaded_import_hangers`, a dependency of `test_threaded_import`, to the directory `test_importlib/`. Also update the import references for `threaded_import_hangers` in `test_threaded_import`. https://bugs.python.org/issue19696
* Move test_threaded_import.py to test_importlib/ (GH-14582)Kyle Stanley2019-07-051-0/+263
|
* bpo-19696: Replace deprecated method in "test_import_pkg.py" (GH-14466)Kyle Stanley2019-07-031-2/+2
| | | | | | | | | Replacing the deprecated method "random.choose" to "random.choice" was technically not part of the original issue. However, it was discussed in the talk page and involved one of the files being moved. I assumed this was too minor to justify the creation of a separate issue. Also, I added my name to the contributors list in Misc/ACKS. This will be my third PR to cpython, forgot to do it in the previous ones. https://bugs.python.org/issue19696
* Remove unused imports in tests (GH-14518)Victor Stinner2019-07-011-1/+0
|
* bpo-19696: Moved "test_pkgimport.py" to dir "test_importlib" (GH-14303)Kyle Stanley2019-06-281-0/+80
| | | | | | | | | Also renamed the file to "test_pkg_import.py" to better follow the naming convention. Component of issue 19696. https://bugs.python.org/issue19696
* bpo-30202 : Update test.test_importlib.test_abc to test find_spec() (GH-12847)Joannah Nanjekye2019-06-211-4/+17
|
* cross port importlib-metadata PR #76 (#13903)Anthony Sottile2019-06-073-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-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.