summaryrefslogtreecommitdiffstats
path: root/Lib/pkgutil.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-97850: Deprecate `find_loader` and `get_loader` in `pkgutil` (GH-98520)Nikita Sobolev2023-05-031-0/+8
| | | | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM> Co-authored-by: Brett Cannon <brett@python.org> Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-98040: Remove find_loader, find_module and other deprecated APIs (#98059)Barry Warsaw2023-05-031-14/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Remove deprecated classes from pkgutil * Remove some other PEP 302 obsolescence * Use find_spec instead of load_module * Remove more tests of PEP 302 obsolete APIs * Remove another bunch of tests using obsolete load_modules() * Remove deleted names from __all__ * Remove obsolete footnote * imp is removed * Remove `imp` from generated stdlib names * What's new and blurb * Update zipimport documentation for the removed methods * Fix some Windows tests * Remove any test (or part of a test) that references `find_module()`. * Use assertIsNone() / assertIsNotNone() consistently. * Update Doc/reference/import.rst * We don't need pkgutil._get_spec() any more either * test.test_importlib.fixtures.NullFinder * ...BadLoaderFinder.find_module * ...test_api.InvalidatingNullFinder.find_module * ...test.test_zipimport test of z.find_module * Suppress cross-references to find_loader and find_module * Suppress cross-references to Finder * Suppress cross-references to pkgutil.ImpImporter and pkgutil.ImpLoader --------- Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* gh-98040: Remove just the `imp` module (#98573)Barry Warsaw2023-04-281-182/+1
|
* gh-68654: Clarify subdirectories used by pkgutil.extend_path (#103701)Randy2023-04-221-4/+4
| | | Clarify sub directories used by pkgutil.extend_path in the docs and the docstring
* [codemod] Fix non-matching bracket pairs (GH-28473)Mohamad Mansour2021-09-211-1/+1
| | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44061: Fix pkgutil.iter_modules regression when passed a pathlib.Path ↵Miguel Brito2021-05-111-0/+1
| | | | object (GH-25964)
* bpo-43720: Update import-related stdlib deprecation messages to say they ↵Brett Cannon2021-04-031-2/+4
| | | | will be removed in Python 3.12 (GH-25167)
* bpo-41006: pkgutil imports lazily re (GH-20939)Victor Stinner2020-06-171-4/+10
| | | | The pkgutil module now imports lazily the re module to speedup Python startup time.
* bpo-12915: Improve Unicode support for package names and attributes. (GH-18517)Vinay Sajip2020-02-281-6/+7
|
* bpo-12915: Add pkgutil.resolve_name (GH-18310)Vinay Sajip2020-02-141-0/+69
|
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | 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-24744: Raises error in pkgutil.walk_packages if path is str (#1926)Sanyam Khurana2017-06-131-0/+3
| | | | | | | | bpo-24744: Raise error in pkgutil.walk_packages if path is str Previously an empty result list was accidentallly returned, since the code iterated over the string as if it were the expected list of paths, and of course found nothing.
* Issue #17211: Yield a namedtuple in pkgutil.Eric Snow2016-09-081-12/+17
| | | | Patch by Ramchandra Apte.
* [merge from 3.5] - Update pkgutil docs to reference appropriate finder and ↵Senthil Kumaran2016-09-061-4/+4
|\ | | | | | | | | | | loader object documentation. Initial patch contributed by Jaysinh shukla.
| * Update pkgutil docs to reference appropriate finder and loader object ↵Senthil Kumaran2016-09-061-4/+4
| | | | | | | | | | | | documentation. Initial patch contributed by Jaysinh shukla.
* | Issue #26896: Disambiguate uses of "importer" with "finder".Brett Cannon2016-07-081-11/+11
| | | | | | | | Thanks to Oren Milman for the patch.
* | Merge 3.5, issue #14209Łukasz Langa2016-06-121-1/+1
|\ \ | |/
| * Issue #14209: pkgutil.iter_zipimport_modules ignores the prefix for packagesŁukasz Langa2016-06-121-1/+1
| | | | | | | | Patch by James Pickering.
* | Upgrade the imp module's deprecation to DeprecationWarning.Brett Cannon2015-10-161-1/+1
|/
* Issue #20383: Introduce importlib.util.module_from_spec().Brett Cannon2014-05-301-1/+1
| | | | | | Along the way, dismantle importlib._bootstrap._SpecMethods as it was no longer relevant and constructing the new function required partially dismantling the class anyway.
* Issue #14710: Fix both pkgutil.find_loader() and get_loader() to notBrett Cannon2014-05-231-1/+3
| | | | | | raise an exception when a module doesn't exist. Thanks to Pavel Aslanov for the bug report.
* Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing.Eric Snow2014-04-191-0/+2
|
* Close #20839: pkgutil.find_loader now uses importlib.util.find_specNick Coghlan2014-03-041-12/+5
|
* Issue 19944: Fix importlib.find_spec() so it imports parents as needed.Eric Snow2014-01-251-1/+1
| | | | The function is also moved to importlib.util.
* Remove more usage of APIs deprecated by PEP 451.Eric Snow2014-01-071-6/+7
|
* Issue #19708: Update pkgutil to use the new importer APIs.Eric Snow2014-01-041-2/+18
|
* Implement PEP 451 (ModuleSpec).Eric Snow2013-11-221-2/+9
|
* Close #19409: add missing import in pkgutilNick Coghlan2013-10-261-0/+1
|
* Issue #17177: The imp module is pending deprecation.Brett Cannon2013-06-161-6/+16
| | | | | | To make sure there is no issue with code that is both Python 2 and 3 compatible, there are no plans to remove the module any sooner than Python 4 (unless the community moves to Python 3 solidly before then).
* Add reference implementation for PEP 443Łukasz Langa2013-06-051-46/+6
| | | | PEP accepted: http://mail.python.org/pipermail/python-dev/2013-June/126734.html
* Merge fix for #16163 from 3.3Nick Coghlan2013-04-141-2/+2
|\
| * Close issue #16163: handle submodules in pkgutil.iter_importersNick Coghlan2013-04-141-2/+2
| |
* | modernize some modules' code by using with statement around open()Giampaolo Rodola'2013-02-121-9/+8
| |
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-1/+1
| |
* | replace threw with raised (#16714)Andrew Svetlov2012-12-191-1/+1
|\ \ | |/
| * replace threw with raised (#16714)Andrew Svetlov2012-12-191-1/+1
| |\
* | \ Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
|\ \ \ | |/ / | | | | | | Patch by Serhiy Storchaka.
| * | Issue #16714: use 'raise' exceptions, don't 'throw'.Andrew Svetlov2012-12-181-1/+1
| |\ \ | | |/ | | | | | | Patch by Serhiy Storchaka.
* | | Issue #16120: Use |yield from| in stdlib.Andrew Svetlov2012-10-071-2/+1
| | | | | | | | | | | | Patch by Berker Peksag.
* | | utilize yield fromPhilip Jenvey2012-10-011-2/+1
|/ /
* | Close #15386: There was a loophole that meant importlib.machinery and imp ↵Nick Coghlan2012-07-201-1/+1
| | | | | | | | would sometimes reference an uninitialised copy of importlib._bootstrap
* | Issue #15343: Handle importlib.machinery.FileFinder instances in ↵Nick Coghlan2012-07-151-0/+43
| | | | | | | | pkgutil.walk_packages (et al)
* | Take the first step in resolving the messy pkgutil vs importlib edge cases ↵Nick Coghlan2012-07-151-51/+43
| | | | | | | | by basing pkgutil explicitly on importlib, deprecating its internal import emulation and setting __main__.__loader__ correctly so that runpy still works (Affects #15343, #15314, #15357)
* | Issue #15294: Fix a regression in pkgutil.extend_path()'s handling of nested ↵Antoine Pitrou2012-07-091-3/+13
| | | | | | | | namespace packages.
* | issue 14660: Implement PEP 420, namespace packages.Eric V. Smith2012-05-251-8/+18
| |
* | Issue #14605: Don't error out if get_importer() returns None.Brett Cannon2012-04-271-0/+2
| |
* | Issue #14605: Make explicit the entries on sys.path_hooks that used toBrett Cannon2012-04-261-8/+5
| | | | | | | | | | | | | | | | | | | | | | | | be implicit. Added a warning for when sys.path_hooks is found to be empty. Also changed the meaning of None in sys.path_importer_cache to represent trying sys.path_hooks again (an interpretation of previous semantics). Also added a warning for when None was found. The long-term goal is for None in sys.path_importer_cache to represent the same as imp.NullImporter: no finder found for that sys.path entry.
* | Issue #13645: pyc files now contain the size of the corresponding sourceAntoine Pitrou2012-01-131-1/+1
| | | | | | | | | | code, to avoid timestamp collisions (especially on filesystems with a low timestamp resolution) when checking for freshness of the bytecode.
* | merge from 3.2Ned Deily2011-10-061-3/+11
|\ \ | |/
| * Issue #7367: Fix pkgutil.walk_paths to skip directories whoseNed Deily2011-10-061-3/+11
| | | | | | | | contents cannot be read.