Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clarification needed in C API arg parsing #57511

Closed
sandrotosi opened this issue Oct 31, 2011 · 4 comments
Closed

Clarification needed in C API arg parsing #57511

sandrotosi opened this issue Oct 31, 2011 · 4 comments
Labels
docs Documentation in the Doc dir

Comments

@sandrotosi
Copy link
Contributor

BPO 13302
Nosy @pitrou, @sandrotosi

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2012-01-01.22:44:21.036>
created_at = <Date 2011-10-31.10:42:43.108>
labels = ['docs']
title = 'Clarification needed in C API arg parsing'
updated_at = <Date 2012-01-01.22:44:21.034>
user = 'https://github.com/sandrotosi'

bugs.python.org fields:

activity = <Date 2012-01-01.22:44:21.034>
actor = 'sandro.tosi'
assignee = 'docs@python'
closed = True
closed_date = <Date 2012-01-01.22:44:21.036>
closer = 'sandro.tosi'
components = ['Documentation']
creation = <Date 2011-10-31.10:42:43.108>
creator = 'sandro.tosi'
dependencies = []
files = []
hgrepos = []
issue_num = 13302
keywords = []
message_count = 4.0
messages = ['146687', '146777', '150446', '150447']
nosy_count = 4.0
nosy_names = ['pitrou', 'sandro.tosi', 'docs@python', 'python-dev']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue13302'
versions = ['Python 2.7']

@sandrotosi
Copy link
Contributor Author

Hello,
given I can't fully comprehend the user request (sent on docs@ as of http://mail.python.org/pipermail/docs/2011-September/005791.html), 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
(http://docs.python.org/c-api/arg.html) is missing the information, that
you must not free the returned const char *, like e.g. said here
(http://docs.python.org/c-api/string.html#PyString_AsString).
It was quite confusing for my first, so I would suggest adding this tiny
bit of information.
<<<

@sandrotosi sandrotosi added the docs Documentation in the Doc dir label Oct 31, 2011
@pitrou
Copy link
Member

pitrou commented Nov 1, 2011

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.”

http://docs.python.org/dev/c-api/arg.html#strings-and-buffers

@python-dev
Copy link
Mannequin

python-dev mannequin commented Jan 1, 2012

New changeset b2b7104691c9 by Sandro Tosi in branch '2.7':
Issue bpo-13302: backport part of 3ed28f28466f
http://hg.python.org/cpython/rev/b2b7104691c9

@sandrotosi
Copy link
Contributor Author

Thanks Antoine for the pointer.

@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

No branches or pull requests

2 participants