summaryrefslogtreecommitdiffstats
path: root/Doc/library/importlib.rst
Commit message (Collapse)AuthorAgeFilesLines
* [3.9] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901)Victor Stinner2020-08-191-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the c_warn_on_allowed_pre_v3 option to make the documentation compatible with Sphinx 2 and Sphinx 3. (cherry picked from commit 423e77d6de497931585d1883805a9e3fa4096b0b) * bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858) Use generic '.. object::' to declare markers, rather than abusing '.. c:function::' which fails on Sphinx 3. (cherry picked from commit 43577c01a2ab49122db696e9eaec6cb31d11cc81) * bpo-40204: Fix duplicates in the documentation (GH-21857) Fix two Sphinx 3 issues: Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'. Declaration is 'PyBUF_ND'. Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'. Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'. (cherry picked from commit 46d10b1237c67ff8347f533eda6a5468d098f7eb) * bpo-40204: Add :noindex: in the documentation (GH-21859) Add :noindex: to duplicated documentation to fix "duplicate object description" errors. For example, fix this Sphinx 3 issue: Doc/library/configparser.rst:1146: WARNING: duplicate object description of configparser.ConfigParser.optionxform, other instance in library/configparser, use :noindex: for one of them (cherry picked from commit d3ded080482beae578faa704b13534a62d066f9f) * bpo-40204, doc: Fix syntax of C variables (GH-21846) For example, fix the following Sphinx 3 errors: Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters Invalid C declaration: Expected identifier in nested name. [error at 5] void \*obj -----^ Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*' Invalid C declaration: Expected end of definition. [error at 8] PyObject* --------^ The modified documentation is compatible with Sphinx 2 and Sphinx 3. (cherry picked from commit 474652fe9346382dbf793f20b671eb74668bebde) * bpo-40204: Fix reference to terms in the doc (GH-21865) Sphinx 3 requires to refer to terms with the exact case. For example, fix the Sphinx 3 warning: Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case sensitive match.made a reference to loader instead. (cherry picked from commit bb0b08540cc93e56f3f1bde1b39ce086d9e35fe1) * bpo-40204: Fix duplicated productionlist names in the doc (GH-21900) Sphinx 3 disallows having more than one productionlist markup with the same name. Simply remove names in this case, since names are not shown anyway. For example, fix the Sphinx 3 warning: Doc/reference/introduction.rst:96: duplicate token description of *:name, other instance in reference/expressions (cherry picked from commit 1abeda80f760134b4233608e2c288790f955b95a)
* [3.9] bpo-40924: Remove protocol for supplying Traversable objects from ↵Jason R. Coombs2020-06-141-3/+0
| | | | | loaders (GH-20820) Remove protocol that loaders can present a files method as found in importlib_resources 1.3-1.6 (added in Python 3.8b1).
* bpo-39791: Add files() to importlib.resources (GH-19722)Jason R. Coombs2020-05-081-0/+37
| | | | | | | | | * bpo-39791: Update importlib.resources to support files() API (importlib_resources 1.5). * 📜🤖 Added by blurb_it. * Add some documentation about the new objects added. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-19698: Document when importlib.machinery.FrozenImporter gained ↵Brett Cannon2020-03-251-0/+4
| | | | spec-related methods (GH-19158)
* bpo-38738: Fix formatting of True and False. (GH-17083)Serhiy Storchaka2019-11-121-1/+1
| | | | | | | | | * "Return true/false" is replaced with "Return ``True``/``False``" if the function actually returns a bool. * Fixed formatting of some True and False literals (now in monospace). * Replaced "True/False" with "true/false" if it can be not only bool. * Replaced some 1/0 with True/False if it corresponds the code. * "Returns <bool>" is replaced with "Return <bool>".
* bpo-37574: Mention helper functions for find_spec documentation (GH-14739)jdkandersson2019-09-101-1/+4
|
* Fix typos mostly in comments, docs and test names (GH-15209)Min ho Kim2019-08-301-2/+2
|
* bpo-37444: Update differing exception between builtins and importlib (GH-14869)Ngalim Siregar2019-08-031-3/+8
| | | | | | | | | | 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
* Swap 'if' branches so content matches to condition in importlib example ↵Tzu-ping Chung2019-07-251-3/+3
| | | | | | | | | (GH-14947) Prior to this change the guard on an 'elif' used an assignment expression whose value was used in a later 'else' block, causing some confusion for people. (Discussion on Twitter: https://twitter.com/brettsky/status/1153861041068994566.) Automerge-Triggered-By: @brettcannon
* bpo-37521: No longer treat insertion into sys.modules as optional in ↵Brett Cannon2019-07-121-9/+9
| | | | | | | | | | importlib examples (GH-14723) Fix importlib examples to insert any newly created modules via importlib.util.module_from_spec() immediately into sys.modules instead of after calling loader.exec_module(). Thanks to Benjamin Mintz for finding the bug. https://bugs.python.org/issue37521
* bpo-37459: importlib docs improperly reference get_resource_loader() (#14568)aldwinaldwin2019-07-041-1/+1
| | | * bpo-37459: importlib docs improperly reference get_resource_loader()
* bpo-35486: Note Py3.6 import system API requirement change (GH-11540)Nick Coghlan2019-01-171-1/+2
| | | | | | | | | | While the introduction of ModuleNotFoundError was fully backwards compatible on the import API consumer side, folks providing alternative implementations of `__import__` need to make an update to be forward compatible with clients that start relying on the new subclass. https://bugs.python.org/issue35486
* bpo-35506: Remove redundant and incorrect links from keywords. (GH-11174)Serhiy Storchaka2018-12-191-4/+4
|
* [Docs] Fix required version of an example of importlib (GH-10118)E Kawashima2018-11-051-1/+1
| | | §31.5.6.3. Importing a source file directly: `module_from_spec` is new in Python 3.5.
* bpo-35044, doc: Use the :exc: role for the exceptions (GH-10037)Stéphane Wirtel2018-10-261-1/+1
|
* importlib doc: Fix approximated import_module() code (GH-9945)orlnub1232018-10-241-1/+1
| | | The spec gets stored on modules with the __spec__ attribute, not spec.
* Fix the versionadded indentation in exec_module doc (GH-8719)Andrés Delfino2018-08-121-1/+1
|
* bpo-33859: Fix spelling mistakes in docs. (GH-7691)Xtreak2018-06-161-1/+1
|
* bpo-33254: do not return an empty list when asking for the contents of a ↵Brett Cannon2018-04-301-4/+4
| | | | namespace package (GH-6467)
* bpo-33169: Remove values of `None` from sys.path_importer_cache when ↵Brett Cannon2018-04-061-1/+6
| | | | | 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-27428: Fix WindowsRegistryFinder documentation to list appropriate ABC ↵Himanshu Lakhara2018-03-231-1/+1
| | | | | | (GH-6061)
* Update and sync importlib.resources documentation (#5694)Barry Warsaw2018-02-161-5/+22
|
* bpo-32303 - Consistency fixes for namespace loaders (#5481)Barry Warsaw2018-02-021-1/+1
| | | | | | | * 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: Introduce the concept of Loader.get_resource_reader() (GH-5108)Brett Cannon2018-01-121-7/+24
|
* bpo-32248 - Implement importlib.resources (#4911)Barry Warsaw2017-12-301-1/+126
| | | | Port importlib_resources to importlib.resources
* bpo-32248: Implement importlib.abc.ResourceReader (GH-4892)Brett Cannon2017-12-161-0/+66
|
* closes bpo-31650: PEP 552 (Deterministic pycs) implementation (#4575)Benjamin Peterson2017-12-091-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | 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-31799: Make module.__spec__ more discoverable (#4010)Barry Warsaw2017-10-171-1/+9
| | | | bpo-31799: Make module.__spec__ more discoverable
* link to legacy doc on the non-legacy website (#3362)Benjamin Peterson2017-09-051-1/+1
|
* bpo-30436: Raise ModuleNotFoundError for importlib.util.find_spec() when ↵Milan Oberkirch2017-06-141-0/+5
| | | | | 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-0/+3
| | | | not found (GH-972)
* Issue #28896: Deprecate WindowsRegistryFinderSteve Dower2016-12-071-0/+4
|
* Fixed double hyphens that are rendered to literal en-dashes in the documenation.Serhiy Storchaka2016-12-041-2/+2
|\
| * Fixed double hyphens that are rendered to literal en-dashes in the documenation.Serhiy Storchaka2016-12-041-2/+2
| |
* | Issue #19795: Mark up None as literal text.Serhiy Storchaka2016-10-191-6/+6
|\ \ | |/
| * Issue #19795: Mark up None as literal text.Serhiy Storchaka2016-10-191-6/+6
| |
* | Issue #27853: Add section headers to the importlib example docsBrett Cannon2016-09-081-0/+19
| |
* | Issue #26667: Add path-like object support to importlib.util.Brett Cannon2016-09-081-0/+9
| |
* | merge 3.5 (#27957)Benjamin Peterson2016-09-051-1/+1
|\ \ | |/
| * remove ungrammarical apostrophe (closes #27957)Benjamin Peterson2016-09-051-1/+1
| |
* | Issue #27626: Merge spelling fixes from 3.5Martin Panter2016-07-281-1/+1
|\ \ | |/
| * Issue #27626: Spelling fixes in docs, comments and internal namesMartin Panter2016-07-281-1/+1
| | | | | | | | Based on patch by Ville Skyttä.
* | Issue #26186: Remove the restriction that built-in and extensionBrett Cannon2016-06-251-14/+24
| | | | | | | | | | | | | | | | modules can't be lazily loaded. Thanks to Python 3.6 allowing for types.ModuleType to have its __class__ mutated, the restriction can be lifted by calling create_module() on the wrapped loader.
* | Merge with 3.5Terry Jan Reedy2016-06-231-0/+14
|\ \ | |/
| * Issue #27304: Source code links for sub-packages in the same file.Terry Jan Reedy2016-06-231-0/+14
| | | | | | | | Patch by Yoni Lavi
* | Merge Issue #22558.Terry Jan Reedy2016-06-111-0/+3
|\ \ | |/
| * Issue #22558: Add remaining doc links to source code for Python-coded modules.Terry Jan Reedy2016-06-111-0/+3
| | | | | | | | | | Reformat header above separator line (added if missing) to a common format. Patch by Yoni Lavi.
* | Issue #27147: Mention PEP 420 in the importlib docs.Eric Snow2016-05-281-0/+3
|\ \ | |/
| * Issue #27147: Mention PEP 420 in the importlib docs.Eric Snow2016-05-281-0/+3
| |
* | Issue #26252: Add an example on how to register a finderBrett Cannon2016-03-181-2/+32
| |