summaryrefslogtreecommitdiffstats
path: root/Lib/pkgutil.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.9] [codemod] Fix non-matching bracket pairs (GH-28473) (GH-28512)Łukasz Langa2021-09-221-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>. (cherry picked from commit 8f943ca25732d548cf9f0b0393ba8d582fb93e29) Co-authored-by: Mohamad Mansour <66031317+mohamadmansourX@users.noreply.github.com>
* bpo-44061: Fix pkgutil.iter_modules regression when passed a pathlib.Path ↵Steve Dower2021-05-121-0/+1
| | | | | object (GH-25964) (GH-26052) Co-authored-by: Miguel Brito <5544985+miguendes@users.noreply.github.com>
* 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.
* | Use a local name (it was intended to be used but overlooked).Éric Araujo2011-09-171-2/+2
| | | | | | | | This was caught in the distutils2 repo by pyflakes.
* | Merge 3.2Éric Araujo2011-05-251-1/+1
|\ \ | |/
| * Merge 3.1Éric Araujo2011-05-251-1/+1
| |\
| | * Add missing name in pkgutil.__all__Éric Araujo2011-05-021-1/+1
| | |
| | * Merged revisions 73833,73838,73850-73852,73856-73857 via svnmerge fromGeorg Brandl2009-08-131-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | svn+ssh://svn.python.org/python/branches/py3k ................ r73833 | gregory.p.smith | 2009-07-04 04:46:54 +0200 (Sa, 04 Jul 2009) | 20 lines Merged revisions 73825-73826 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r73825 | gregory.p.smith | 2009-07-03 18:49:29 -0700 (Fri, 03 Jul 2009) | 9 lines Use select.poll() in subprocess, when available, rather than select() so that it does not fail when file descriptors are large. Fixes issue3392. Patch largely contributed by Frank Chu (fpmc) with some improvements by me. See http://bugs.python.org/issue3392. ........ r73826 | gregory.p.smith | 2009-07-03 18:55:11 -0700 (Fri, 03 Jul 2009) | 2 lines news entry for r73825 ........ Candidate for backporting to release31-maint as it is a bug fix and changes no public API. ................ r73838 | gregory.p.smith | 2009-07-04 10:32:15 +0200 (Sa, 04 Jul 2009) | 2 lines change deprecated unittest method calls into their proper names. ................ r73850 | alexandre.vassalotti | 2009-07-05 07:38:18 +0200 (So, 05 Jul 2009) | 3 lines Issue 4509: Do not modify an array if we know the change would result in a failure due to exported buffers. ................ r73851 | alexandre.vassalotti | 2009-07-05 07:47:28 +0200 (So, 05 Jul 2009) | 2 lines Add more test cases to BaseTest.test_memoryview_no_resize. ................ r73852 | alexandre.vassalotti | 2009-07-05 08:25:14 +0200 (So, 05 Jul 2009) | 5 lines Fix array.extend and array.__iadd__ to handle the case where an array is extended with itself. This bug is specific the py3k version of arraymodule.c ................ r73856 | alexandre.vassalotti | 2009-07-05 08:42:44 +0200 (So, 05 Jul 2009) | 6 lines Issue 4005: Remove .sort() call on dict_keys object. This caused pydoc to fail when there was a zip file in sys.path. Patch contributed by Amaury Forgeot d'Arc. ................ r73857 | alexandre.vassalotti | 2009-07-05 08:50:08 +0200 (So, 05 Jul 2009) | 2 lines Add NEWS entries for the changes I made recently. ................
* | | Replace open(filename, 'rU') by open(filename, 'r')Victor Stinner2011-05-041-2/+2
|/ / | | | | | | The U flag is no more used (but still accepted for backward compatibility).