[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2020-04-22 Thread Inada Naoki


Inada Naoki  added the comment:

Fixed via GH-18663.

--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2020-01-25 Thread Iustin Pop


Change by Iustin Pop :


--
keywords: +patch
pull_requests: +17566
stage: needs patch -> patch review
pull_request: https://github.com/python/cpython/pull/17478

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-12-09 Thread Serhiy Storchaka


Change by Serhiy Storchaka :


--
keywords: +easy
stage:  -> needs patch
type:  -> enhancement
versions: +Python 2.7 -Python 3.5, Python 3.6

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-12-09 Thread STINNER Victor


Change by STINNER Victor :


--
components: +C API

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-07-01 Thread Inada Naoki


Inada Naoki  added the comment:

> Oh! Fair enough, I had missed it. Does the note also involve `Py_BuildValue`? 
> If so, the documentation of `Py_BuildValue` should probably be updated; if 
> not, I think it would be clearer if the note mentioned that it only applies 
> to parsing, not building, values.

Yes, this is same to Py_BuildValue.  The document of Py_BuildValue
should be `int or Py_ssize_t` too.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-07-01 Thread Enrico Zini


Enrico Zini  added the comment:

Oh! Fair enough, I had missed it. Does the note also involve `Py_BuildValue`? 
If so, the documentation of `Py_BuildValue` should probably be updated; if not, 
I think it would be clearer if the note mentioned that it only applies to 
parsing, not building, values.

--

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-07-01 Thread Inada Naoki


Inada Naoki  added the comment:

See note in https://docs.python.org/3.9/c-api/arg.html#strings-and-buffers

"""
Note: For all # variants of formats (s#, y#, etc.), the type of the length 
argument (int or Py_ssize_t) is controlled by defining the macro 
PY_SSIZE_T_CLEAN before including Python.h. If the macro was defined, length is 
a Py_ssize_t rather than an int. This behavior will change in a future Python 
version to only support Py_ssize_t and drop int support. It is best to always 
define PY_SSIZE_T_CLEAN. 
"""

--
nosy: +inada.naoki

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue37465] Incorrect documentation for `s#` arguments in C API argument parsing

2019-07-01 Thread Enrico Zini


New submission from Enrico Zini :

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@python
components: Documentation
messages: 346974
nosy: docs@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 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com