This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Missing return values for PyUnicode C/API functions
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 3.2, Python 3.3, Python 3.4, Python 2.7
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: docs@python Nosy List: arnau, ezio.melotti, georg.brandl, lemburg, serhiy.storchaka, torsten.becker
Priority: normal Keywords: patch

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:59adminsetgithub: 52516
2020-02-26 18:46:36serhiy.storchakasetstatus: open -> closed

nosy: + serhiy.storchaka
messages: + msg362710

resolution: out of date
stage: patch review -> resolved
2012-11-08 08:32:55ezio.melottisetstage: patch review
versions: + Python 3.4, - Python 3.1
2011-04-03 10:51:09torsten.beckersetfiles: + issue-8269-v1.patch

nosy: + torsten.becker
messages: + msg132834

keywords: + patch
2011-03-09 03:15:49terry.reedysetnosy: lemburg, georg.brandl, ezio.melotti, arnau
versions: + Python 3.3
2010-10-29 10:07:21adminsetassignee: georg.brandl -> docs@python
2010-08-07 18:38:10terry.reedysetversions: - Python 2.6
2010-07-11 01:59:15terry.reedysetversions: + Python 2.7, - Python 3.3
2010-04-01 20:10:09georg.brandlsetmessages: + msg102129
2010-03-31 18:14:39lemburgsetmessages: + msg102025
2010-03-31 07:17:23arnausetmessages: + msg101985
2010-03-31 07:16:48arnausetmessages: + msg101984
2010-03-31 06:48:56ezio.melottisetpriority: normal
nosy: + ezio.melotti
messages: + msg101983

2010-03-31 00:09:27pitrousetnosy: + lemburg
2010-03-30 23:26:56arnaucreate