[ python-Bugs-1546052 ] PyString_FromString() clarification

SourceForge.net noreply at sourceforge.net
Thu Aug 24 17:38:33 CEST 2006


Bugs item #1546052, was opened at 2006-08-24 17:38
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1546052&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Documentation
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Christian Walther (cwalther)
Assigned to: Nobody/Anonymous (nobody)
Summary: PyString_FromString() clarification

Initial Comment:
The documentation for PyObject* PyString_FromString(
const char *v) in the "Python/C API Reference Manual,
29 March 2006, Release 2.4.3", section 7.3.1 "String
Objects"
<http://docs.python.org/api/stringObjects.html>, does
not mention whether this function makes a copy of the
passed C string or just keeps the pointer.

Google provides some posts on various mailing lists and
forums that seem to indicate that it indeed does copy
the string (which is the right thing to do, of course).

Could something like to following be added to the
documentation?

"This function makes a copy of the string pointed to by
v, so you may modify or deallocate it afterwards
without affecting the Python object created by this
function."

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1546052&group_id=5470


More information about the Python-bugs-list mailing list