Title: Clarification needed in C API arg parsing
Type: Stage: resolved
Components: Documentation Versions: Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, pitrou, python-dev, sandro.tosi
Priority: normal Keywords:

Created on 2011-10-31 10:42 by sandro.tosi, last changed 2012-01-01 22:44 by sandro.tosi. This issue is now closed.

Messages (4)
msg146687 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2011-10-31 10:42
given I can't fully comprehend the user request (sent on docs@ as of, I'm just echoing it :

recently I embedded Python into one of my applications, which included
some string parsing.
In my opinion the doc page about parsing arguments
( is missing the information, that
you must not free the returned const char *, like e.g. said here
It was quite confusing for my first, so I would suggest adding this tiny
bit of information.
msg146777 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2011-11-01 14:07
It's already in the 3.x docs (but not 2.x):

“Strings and buffers

These formats allow to access an object as a contiguous chunk of memory. You don’t have to provide raw storage for the returned unicode or bytes area. Also, you won’t have to release any memory yourself, except with the es, es#, et and et# formats.”
msg150446 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2012-01-01 22:43
New changeset b2b7104691c9 by Sandro Tosi in branch '2.7':
Issue #13302: backport part of 3ed28f28466f
msg150447 - (view) Author: Sandro Tosi (sandro.tosi) * (Python committer) Date: 2012-01-01 22:44
Thanks Antoine for the pointer.
Date User Action Args
2012-01-01 22:44:21sandro.tosisetstatus: open -> closed
versions: - Python 3.2, Python 3.3
messages: + msg150447

resolution: fixed
stage: needs patch -> resolved
2012-01-01 22:43:01python-devsetnosy: + python-dev
messages: + msg150446
2011-11-01 14:07:10pitrousetnosy: + pitrou
messages: + msg146777
2011-10-31 10:42:43sandro.tosicreate