diff options
author | Brett Cannon <brett@python.org> | 2012-07-13 17:57:03 (GMT) |
---|---|---|
committer | Brett Cannon <brett@python.org> | 2012-07-13 17:57:03 (GMT) |
commit | a6473f9cfd13358b003b8353cd722ca19352817c (patch) | |
tree | 3533968bc996698be3bd30eb80ecb5b6dea05f85 /Doc/c-api | |
parent | d104eef118bda30725ac087e06252a5a3525e2df (diff) | |
download | cpython-a6473f9cfd13358b003b8353cd722ca19352817c.zip cpython-a6473f9cfd13358b003b8353cd722ca19352817c.tar.gz cpython-a6473f9cfd13358b003b8353cd722ca19352817c.tar.bz2 |
Issues #15169, #14599: Make PyImport_ExecCodeModuleWithPathnames() use
Lib/imp.py for imp.source_from_cache() instead of its own C version.
Also change PyImport_ExecCodeModuleObject() to not infer the source
path from the bytecode path like
PyImport_ExecCodeModuleWithPathnames() does. This makes the function
less magical.
This also has the side-effect of removing all uses of MAXPATHLEN in
Python/import.c which can cause failures on really long filenames.
Diffstat (limited to 'Doc/c-api')
-rw-r--r-- | Doc/c-api/import.rst | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Doc/c-api/import.rst b/Doc/c-api/import.rst index 2d0d1b5..c718057 100644 --- a/Doc/c-api/import.rst +++ b/Doc/c-api/import.rst @@ -163,9 +163,14 @@ Importing Modules .. c:function:: PyObject* PyImport_ExecCodeModuleWithPathnames(char *name, PyObject *co, char *pathname, char *cpathname) Like :c:func:`PyImport_ExecCodeModuleObject`, but *name*, *pathname* and - *cpathname* are UTF-8 encoded strings. + *cpathname* are UTF-8 encoded strings. Attempts are also made to figure out + what the value for *pathname* should be from *cpathname* if the former is + set to ``NULL``. .. versionadded:: 3.2 + .. versionchanged:: 3.3 + Uses :func:`imp.source_from_cache()` in calculating the source path if + only the bytecode path is provided. .. c:function:: long PyImport_GetMagicNumber() |