Issue 8269: Missing return values for PyUnicode C/API functions (original) (raw)

Created on 2010-03-30 23:26 by arnau, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issue-8269-v1.patch torsten.becker,2011-04-03 10:51 Adds missing PyUnicode functions to Doc/data/refcounts.dat review
Messages (8)
msg101959 - (view) Author: Arnaud Fontaine (arnau) Date: 2010-03-30 23:26
For example, PyUnicode_FromFormat() does not specify the return value but it does not seem to be only one. I only have a basic knowledge of Python C/API, so I am not sure whether it is meaningful.
msg101983 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2010-03-31 06:48
if you are referring to http://docs.python.org/dev/py3k/c-api/unicode.html#PyUnicode_FromFormat the return type is a PyObject. See also http://docs.python.org/dev/py3k/c-api/structures.html#PyObject
msg101984 - (view) Author: Arnaud Fontaine (arnau) Date: 2010-03-31 07:16
I meant whether it returns a new reference or not. For instance, documentation for PyUnicode_FromObject() and PyUnicode_AsWideChar() states that a new reference is returned, but this is most specified for most functions in Unicode Object (at least).
msg101985 - (view) Author: Arnaud Fontaine (arnau) Date: 2010-03-31 07:17
I meant whether it returns a new reference or not. For instance, documentation for PyUnicode_FromObject() and PyUnicode_AsWideChar() states that a new reference is returned, but this is not specified for most functions in Unicode Object (at least).
msg102025 - (view) Author: Marc-Andre Lemburg (lemburg) * (Python committer) Date: 2010-03-31 18:14
Arnaud Fontaine wrote: > > Arnaud Fontaine <arnau@debian.org> added the comment: > > I meant whether it returns a new reference or not. For instance, documentation for PyUnicode_FromObject() and PyUnicode_AsWideChar() states that a new reference is returned, but this is not specified for most functions in Unicode Object (at least). Patches are welcome ! FWIW: Unless otherwise noted, all Unicode APIs that return a PyObject* give you a new reference.
msg102129 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2010-04-01 20:10
I'd like to add that a patch would need to modify Doc/data/refcounts.dat, not the .rst files.
msg132834 - (view) Author: Torsten Becker (torsten.becker) Date: 2011-04-03 10:51
Hi, I read through unicodeobject.c and added the (IMO) proper reference counts to the missing functions. I attached a first patch which adds this to Doc/data/refcounts.dat. The patch also fixes 2 minor glitches in Doc/c-api/unicode.rst, PyUnicode_DecodeMBCSStateful stated int instead of Py_ssize_t for it's arguments and PyUnicode_FromString had it's return value wrongly formated.
msg362710 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2020-02-26 18:46
Sorry, we missed this issue. refcounts.dat was updated in other issues.
History
Date User Action Args
2022-04-11 14:56:59 admin set github: 52516
2020-02-26 18:46:36 serhiy.storchaka set status: open -> closednosy: + serhiy.storchakamessages: + resolution: out of datestage: patch review -> resolved
2012-11-08 08:32:55 ezio.melotti set stage: patch reviewversions: + Python 3.4, - Python 3.1
2011-04-03 10:51:09 torsten.becker set files: + issue-8269-v1.patchnosy: + torsten.beckermessages: + keywords: + patch
2011-03-09 03:15:49 terry.reedy set nosy:lemburg, georg.brandl, ezio.melotti, arnauversions: + Python 3.3
2010-10-29 10:07:21 admin set assignee: georg.brandl -> docs@python
2010-08-07 18:38:10 terry.reedy set versions: - Python 2.6
2010-07-11 01:59:15 terry.reedy set versions: + Python 2.7, - Python 3.3
2010-04-01 20:10:09 georg.brandl set messages: +
2010-03-31 18:14:39 lemburg set messages: +
2010-03-31 07:17:23 arnau set messages: +
2010-03-31 07:16:48 arnau set messages: +
2010-03-31 06:48:56 ezio.melotti set priority: normalnosy: + ezio.melottimessages: +
2010-03-31 00:09:27 pitrou set nosy: + lemburg
2010-03-30 23:26:56 arnau create