[New-bugs-announce] [issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

Enrico Zini report at bugs.python.org
Mon Jul 1 04:20:20 EDT 2019


New submission from Enrico Zini <enrico at enricozini.org>:

In https://docs.python.org/3.9/c-api/arg.html, in the documentation for parsing argument, there is:

     s# (str, read-only bytes-like object) [const char *, int or Py_ssize_t]

In my amd64 system, `Py_ssize_t` is a different type than `int`, and passing a `Py_ssize_t` causes undefine behaviour.

I assume this has been switched to an `int` in the API, and that thisinstance of the documentation has not been updated accordingly. At the bottom of the page in the documentation of `Py_BuildValue`, `s#` is correctly documented as using an `int` and no `Py_ssize_t`, for example.

----------
assignee: docs at python
components: Documentation
messages: 346974
nosy: docs at python, enrico
priority: normal
severity: normal
status: open
title: Incorrect documentation for `s#` arguments in C API argument parsing
versions: Python 3.5, Python 3.6, Python 3.7, Python 3.8, Python 3.9

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


More information about the New-bugs-announce mailing list