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: Minor C API documentation bugs
Type: behavior Stage:
Components: Documentation Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: baruch.sterin, docs@python, ejjy, eli.bendersky, loewis, vstinner
Priority: normal Keywords: easy, patch

Created on 2012-03-04 06:06 by baruch.sterin, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
issues14190.diff ejjy, 2012-03-11 02:15 diff file review
issues14190-2.diff ejjy, 2012-03-11 03:07 second fixes review
Messages (6)
msg154879 - (view) Author: Baruch Sterin (baruch.sterin) Date: 2012-03-04 06:06
The following functions are documented, but do not exist in the code:

* PyCodec_KnownEncoding
* PyRun_SimpleFileFlags

The following function is documented and exists in the code, but is not exposed through any of the header files:

PyParser_SimpleParseStringFlagsFilename

The prototype in the documentation is incorrect:

* PyOS_stricmp returns int, not char*
* PyOS_strnicmp returns int, not char*
* PyCode_GetNumFree accepts a PyCodeObject* not PyObject*
* PyCode_NewEmpty returns a PyCodeObject* not PyObject*
* PyFile_SetBufSize accepts a PyObject*, not PyCodeObject
* PyGILState_GetThisThreadState returns PyThreadState* not PyThreadState
* PyUnicode_EncodeRawUnicodeEscape accepts 2, not 3 arguments
* PyUnicode_RichCompare returns PyObject*, not int
* PyType_IS_GC needs a PyTypeObject*, not PyObject*
* PyType_HasFeature needs a PyTypeObject*, not PyObject*

In addition, PyLong_FromSsize_t and PyLong_FromSsize_t are documented twice in long.html.
msg154884 - (view) Author: Baruch Sterin (baruch.sterin) Date: 2012-03-04 09:01
A few additional ones:

The prototype in the documentation is incorrect:

* PyFile_SetEncoding accepts PyObject*, not PyFileObject*
* PyFile_SetEncodingAndErrors accepts PyObject*, not PyFileObject*

PyLong_AsSsize_t is also duplicated.
msg155364 - (view) Author: Ejaj Hassan (ejjy) Date: 2012-03-11 02:15
The patch removes the function *PyCodec_KnownEncoding
form document codec.rst
found in cpython/doc/c-api
msg155369 - (view) Author: Ejaj Hassan (ejjy) Date: 2012-03-11 03:07
The diff file is the second submission containing the fixes to the following bugs:
* PyCode_GetNumFree accepts a PyCodeObject* not PyObject*
* PyOS_strnicmp returns int, not char*
* PyUnicode_RichCompare returns PyObject*, not int
* PyType_IS_GC needs a PyTypeObject*, not PyObject*
* PyType_HasFeature needs a PyTypeObject*, not PyObject*
 
Well, if the problems given are specified with each's version, then it would make it easier. Some of the reported bugs are not associated with version 2.7
msg162194 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2012-06-03 05:12
Fixed what was relevant for default (3.3) in 90f0dd118aa4 (the commit message there has a typo in the issue number).

Since 3.3 is going to be out soon, I see no real reason to backport to 3.2

If anyone is willing to create a complete patch for 2.7 that fixes the relevant issues, I will review it. Ejaj, are your diffs for 2.7? Can you create a single patch?
msg165367 - (view) Author: Eli Bendersky (eli.bendersky) * (Python committer) Date: 2012-07-13 07:23
Closing, as I don't think it's terribly important to backport this.
History
Date User Action Args
2022-04-11 14:57:27adminsetgithub: 58398
2012-07-13 07:23:42eli.benderskysetstatus: open -> closed
resolution: fixed
messages: + msg165367
2012-06-03 05:12:07eli.benderskysetmessages: + msg162194
2012-03-11 03:07:59ejjysetfiles: + issues14190-2.diff

messages: + msg155369
2012-03-11 02:15:53ejjysetfiles: + issues14190.diff

nosy: + ejjy
messages: + msg155364

keywords: + patch
2012-03-05 06:47:46eric.araujosetnosy: + loewis, vstinner
2012-03-04 19:11:14eli.benderskysetkeywords: + easy
versions: + Python 3.2, Python 3.3
2012-03-04 09:01:51baruch.sterinsetmessages: + msg154884
2012-03-04 08:59:53eli.benderskysetnosy: + eli.bendersky
2012-03-04 06:06:07baruch.sterincreate