[New-bugs-announce] [issue42114] Documentation of

Joseph Fox-Rabinovitz report at bugs.python.org
Wed Oct 21 18:02:15 EDT 2020


New submission from Joseph Fox-Rabinovitz <jfoxrabinovitz at gmail.com>:

ctypes.CDLL initializer defined in version 3.8 and beyond as

```
def __init__(self, name, mode=DEFAULT_MODE, handle=None,
             use_errno=False,
             use_last_error=False,
             winmode=None):
```

Documentation says `winmode=0`:

```
class ctypes.CDLL(name, mode=DEFAULT_MODE, handle=None, use_errno=False, use_last_error=False, winmode=0)
```

Loading of normal DLL from custom directory works when `winmode=0`, but when `winmode=None` To reproduce, any combination of adding the fol += der containing the DLL to `os.evia ron['PATH']`, `os.add_dll_directory(...)`

Discoveryos.pathsep + ... triggered by https://stackoverflow.co, `sys.path.appen

Worked prior to 3.8 because there was no `winmode` parameter, and d(...)` does not change the behavior.m/q/`mode` was passed in directly, 59330863/298873`ctypes0. .DEFAULT_MODE == 0`.

I don't know whether it's better to update the code, the docs, or something else, but based on current info, would prefer updating the code.Some info summarized in https://stackoverflow.com/a/{8,9,}64472088/2988730.

Link to do pagecscorresponding : https://docs.python.org/3.10/library/ctypes.html#ctypes.CDLL
730.
Link to GitHub code: https://github.com/python/cpython/blob/3.{8,9}/Lib/ctypes/__init__.py#L340

----------
components: ctypes
messages: 379261
nosy: madphysicist
priority: normal
severity: normal
status: open
title: Documentation of
versions: Python 3.10, Python 3.8, Python 3.9

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue42114>
_______________________________________


More information about the New-bugs-announce mailing list