summaryrefslogtreecommitdiffstats
path: root/Lib/pkgutil.py
Commit message (Collapse)AuthorAgeFilesLines
* 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).
* | Have pkgutil properly close files.Brett Cannon2010-10-291-1/+2
| |
* | Issue 4005: Remove .sort() call on dict_keys object.Alexandre Vassalotti2009-07-051-2/+1
|/ | | | | | This caused pydoc to fail when there was a zip file in sys.path. Patch contributed by Amaury Forgeot d'Arc.
* no 2.3 compat in the py3k lib #3676Benjamin Peterson2009-02-161-3/+0
|
* Merged revisions ↵Christian Heimes2008-04-191-0/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 62350-62355,62358-62359,62364-62365,62370,62372-62375,62378-62379,62381 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r62350 | nick.coghlan | 2008-04-15 12:25:31 +0200 (Tue, 15 Apr 2008) | 1 line Issue 2439: add pkgutils.get_data() as a convenience wrapper for the PEP 302 get_data() API (contributed by Paul Moore) ........ r62351 | nick.coghlan | 2008-04-15 12:28:14 +0200 (Tue, 15 Apr 2008) | 1 line Add test file missing from rev 62350 ........ r62352 | benjamin.peterson | 2008-04-15 13:58:46 +0200 (Tue, 15 Apr 2008) | 2 lines Add myself to Doc/ACKS.txt ........ r62353 | andrew.kuchling | 2008-04-15 15:10:07 +0200 (Tue, 15 Apr 2008) | 6 lines Add *,**,@ to index, as suggested by http://farmdev.com/thoughts/24/what-does-the-def-star-variable-or-def-asterisk-parameter-syntax-do-in-python-/ The right entry type to use isn't clear; operator seems wrong, because *,**,@ aren't being used in expressions here. I put them as 'statement'; 'syntax' might be better. ........ r62354 | andrew.kuchling | 2008-04-15 15:10:41 +0200 (Tue, 15 Apr 2008) | 1 line Typo fix ........ r62355 | mark.dickinson | 2008-04-15 22:51:18 +0200 (Tue, 15 Apr 2008) | 3 lines Fix for possible signed overflow: the behaviour of -LONG_MIN is undefined in ANSI C. ........ r62358 | jeroen.ruigrok | 2008-04-16 14:47:01 +0200 (Wed, 16 Apr 2008) | 2 lines Reformat to 80 columns prior to adding documentation. ........ r62359 | jeroen.ruigrok | 2008-04-16 14:57:43 +0200 (Wed, 16 Apr 2008) | 2 lines Add details about the return value for mmap.flush(). ........ r62364 | raymond.hettinger | 2008-04-17 12:48:31 +0200 (Thu, 17 Apr 2008) | 1 line Issue 2648: Add leading zero to money format recipe in the docs. ........ r62365 | jeroen.ruigrok | 2008-04-17 14:39:45 +0200 (Thu, 17 Apr 2008) | 2 lines Be consistent in the use of read-only. ........ r62370 | andrew.kuchling | 2008-04-17 22:44:06 +0200 (Thu, 17 Apr 2008) | 1 line Typo fixes ........ r62372 | andrew.kuchling | 2008-04-18 04:40:47 +0200 (Fri, 18 Apr 2008) | 1 line Use correct parameter name ........ r62373 | andrew.kuchling | 2008-04-18 18:53:09 +0200 (Fri, 18 Apr 2008) | 1 line #2654: fix typo ........ r62374 | andrew.kuchling | 2008-04-18 20:28:23 +0200 (Fri, 18 Apr 2008) | 4 lines Remove personal note from Jim Roskind; it no longer applies, and the e-mail address is for a previous employer. Can we move the big long copyright statement into a sidebar or something? ........ r62375 | andrew.kuchling | 2008-04-18 20:39:55 +0200 (Fri, 18 Apr 2008) | 1 line Rewrite introductory section, and remove old section. (It was already commented-out, but why keep it?) ........ r62378 | skip.montanaro | 2008-04-18 22:35:46 +0200 (Fri, 18 Apr 2008) | 1 line resolve issue 2014 ........ r62379 | benjamin.peterson | 2008-04-18 22:45:33 +0200 (Fri, 18 Apr 2008) | 2 lines Fix indentation in sysmodule.c ........ r62381 | amaury.forgeotdarc | 2008-04-19 01:31:33 +0200 (Sat, 19 Apr 2008) | 3 lines Some tests did not pass on repeated calls (regrtest -R::) Perform additional cleanup, mostly deleting from sys.modules, or clearing the warnings registry. ........