summaryrefslogtreecommitdiffstats
path: root/Doc/library/os.rst
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@microsoft.com>2019-03-29 23:37:16 (GMT)
committerGitHub <noreply@github.com>2019-03-29 23:37:16 (GMT)
commit2438cdf0e932a341c7613bf4323d06b91ae9f1f1 (patch)
tree231cdf3f22e1d5eb9f88fe7a511ab47e3cf8d225 /Doc/library/os.rst
parent32119e10b792ad7ee4e5f951a2d89ddbaf111cc5 (diff)
downloadcpython-2438cdf0e932a341c7613bf4323d06b91ae9f1f1.zip
cpython-2438cdf0e932a341c7613bf4323d06b91ae9f1f1.tar.gz
cpython-2438cdf0e932a341c7613bf4323d06b91ae9f1f1.tar.bz2
bpo-36085: Enable better DLL resolution on Windows (GH-12302)
Diffstat (limited to 'Doc/library/os.rst')
-rw-r--r--Doc/library/os.rst30
1 files changed, 30 insertions, 0 deletions
diff --git a/Doc/library/os.rst b/Doc/library/os.rst
index f8803af..85e240a 100644
--- a/Doc/library/os.rst
+++ b/Doc/library/os.rst
@@ -3079,6 +3079,36 @@ to be ignored.
:func:`signal.signal`.
+.. function:: add_dll_directory(path)
+
+ Add a path to the DLL search path.
+
+ This search path is used when resolving dependencies for imported
+ extension modules (the module itself is resolved through sys.path),
+ and also by :mod:`ctypes`.
+
+ Remove the directory by calling **close()** on the returned object
+ or using it in a :keyword:`with` statement.
+
+ See the `Microsoft documentation
+ <https://msdn.microsoft.com/44228cf2-6306-466c-8f16-f513cd3ba8b5>`_
+ for more information about how DLLs are loaded.
+
+ .. availability:: Windows.
+
+ .. versionadded:: 3.8
+ Previous versions of CPython would resolve DLLs using the default
+ behavior for the current process. This led to inconsistencies,
+ such as only sometimes searching :envvar:`PATH` or the current
+ working directory, and OS functions such as ``AddDllDirectory``
+ having no effect.
+
+ In 3.8, the two primary ways DLLs are loaded now explicitly
+ override the process-wide behavior to ensure consistency. See the
+ :ref:`porting notes <bpo-36085-whatsnew>` for information on
+ updating libraries.
+
+
.. function:: execl(path, arg0, arg1, ...)
execle(path, arg0, arg1, ..., env)
execlp(file, arg0, arg1, ...)