summaryrefslogtreecommitdiff
path: root/Modules/cStringIO.c
AgeCommit message (Collapse)AuthorLines
2016-09-17Issue #28139: Fix messed up indentationMartin Panter-8/+8
Also update the classmethod and staticmethod doc strings and comments to match the RST documentation.
2013-03-19Issue #10212: Support new buffer interface for struct.unpack andKristján Valur Jónsson-24/+25
cStringIO
2013-02-12Issue #13555: cPickle now supports files larger than 2 GiB.Serhiy Storchaka-5/+2
2013-02-09Issue #7358: cStringIO.StringIO now supports writing to and reading fromSerhiy Storchaka-32/+53
a stream larger than 2 GiB on 64-bit systems.
2012-08-15Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵Antoine Pitrou-1/+5
errors correctly. Patch by Serhiy Storchaka.
2011-10-22Issue #1548891: The cStringIO.StringIO() constructor now encodes unicodeAntoine Pitrou-1/+5
arguments with the system default encoding just like the write() method does, instead of converting it to a raw buffer.
2010-10-11improve performance of writing past the end of the file for cStringIOFred Drake-40/+18
(http://bugs.python.org/issue10045)
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-348/+348
2010-03-25Backported PyCapsule from 3.1, and converted most uses ofLarry Hastings-2/+2
CObject to PyCapsule.
2008-06-11Merge in release25-maint r60793:Gregory P. Smith-2/+13
Added checks for integer overflows, contributed by Google. Some are only available if asserts are left in the code, in cases where they can't be triggered from Python code.
2008-06-09This reverts r63675 based on the discussion in this thread:Gregory P. Smith-7/+7
http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
2008-05-26Renamed PyString to PyBytesChristian Heimes-7/+7
2008-02-16Crashers of the day: Py_CLEAR must be used when there is a chance that theAmaury Forgeot d'Arc-2/+1
function can be called recursively. This was discussed in issue1020188. In python codebase, all occurrences of Py_[X]DECREF(xxx->yyy) are suspect, except when they appear in tp_new or tp_dealloc functions, or when the member cannot be of a user-defined class. Note that tp_init is not safe. I do have a (crashing) example for every changed line. Is it worth adding them to the test suite? Example: class SpecialStr(str): def __del__(self): s.close() import cStringIO s = cStringIO.StringIO(SpecialStr("text")) s.close() # Segfault
2007-12-19#1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes-2/+2
Py_REFCNT. Macros for b/w compatibility are available.
2007-08-08Fix compilation warning.Georg Brandl-1/+1
2007-08-08Revert the fix for #1548891, it broke backwards compatibility with arbitrary ↵Georg Brandl-2/+5
read buffers. Fixes #1730114.
2007-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-6/+4
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2007-04-25Merge change 54909 from release25-maint: Fix several minor issues ↵Kristján Valur Jónsson-4/+12
discovered using code analysis in VisualStudio 2005 Team Edition
2006-11-19Make cStringIO.truncate raise IOError for negativeMartin v. Löwis-1/+11
arguments (even for -1). Fixes the last bit of #1359365.
2006-10-18newIobject(): repaired incorrect cast to quiet MSVC warning.Tim Peters-1/+1
2006-10-12Bug #1548891: The cStringIO.StringIO() constructor now encodes unicodeGeorg Brandl-4/+2
arguments with the system default encoding just like the write() method does, instead of converting it to a raw buffer.
2006-03-30Remove unnecessary casts from type object initializers.Georg Brandl-13/+13
2006-03-15SF patch #1359365: cStringIO.StringIO.isatty() will raise a ValueErrorWalter Dörwald-1/+2
now if close() has been called before (like file and StringIO.StringIO do)
2006-03-07SF #1444030: Fix several potential defects found by Coverity.Hye-Shik Chang-0/+1
(reviewed by Neal Norwitz)
2006-03-01Remove UNLESS.Martin v. Löwis-29/+28
2006-03-01Silence gcc (4.0.x) warning about use of uninitialized value.Thomas Wouters-1/+1
2006-02-16Use Py_ssize_t for counts and sizes.Martin v. Löwis-3/+3
2006-02-15Merge ssize_t branch.Martin v. Löwis-24/+31
2006-01-19Check return result from Py_InitModule*(). This API can fail.Neal Norwitz-0/+1
Probably should be backported.
2005-12-10Add const to several API functions that take char *.Jeremy Hylton-1/+1
In C++, it's an error to pass a string literal to a char* function without a const_cast(). Rather than require every C++ extension module to put a cast around string literals, fix the API to state the const-ness. I focused on parts of the API where people usually pass literals: PyArg_ParseTuple() and friends, Py_BuildValue(), PyMethodDef, the type slots, etc. Predictably, there were a large set of functions that needed to be fixed as a result of these changes. The most pervasive change was to make the keyword args list passed to PyArg_ParseTupleAndKewords() to be a const char *kwlist[]. One cast was required as a result of the changes: A type object mallocs the memory for its tp_doc slot and later frees it. PyTypeObject says that tp_doc is const char *; but if the type was created by type_new(), we know it is safe to cast to char *.
2005-09-22Patches #1298449 and #1298499: Add some missing checks for errorMichael W. Hudson-7/+15
returns in cStringIO.c. Thanks to Andrew Bennetts. This must be a backport candidate.
2004-08-21Patch 1012740: cStringIO's truncate doesn'tTim Peters-0/+1
truncate() left the stream position unchanged, which meant the "truncated" data didn't go away: >>> io.write('abc') >>> io.truncate(0) >>> io.write('xyz') >>> io.getvalue() 'abcxyz' Patch by Dima Dorfman.
2004-06-27sizeof(char) is 1, by definition, so get rid of that expression inTim Peters-5/+4
places it's just noise.
2004-03-08SF patch #907403: Improvements to cStringIO.writelines()Raymond Hettinger-28/+23
The writelines() method now accepts any iterable argument and writes the lines one at a time rather than using ''.join(lines) followed by a single write. Results in considerable memory savings and makes the method suitable for use with generator expressions.
2004-02-27Speed-up the joiner call by avoiding Py_BuildValue().Raymond Hettinger-1/+5
2003-10-12Simplify and speedup uses of Py_BuildValue():Raymond Hettinger-1/+1
* Py_BuildValue("(OOO)",a,b,c) --> PyTuple_Pack(3,a,b,c) * Py_BuildValue("()",a) --> PyTuple_New(0) * Py_BuildValue("O", a) --> Py_INCREF(a)
2003-08-11reverting to 2.41 version (distinct tp_names) - will add verbiage to theSkip Montanaro-2/+2
docs
2003-08-11shit - just change the visible name, not the comments - strictly speaking,Skip Montanaro-3/+3
the tp_name is not correct, but what's exposed to users is known visibly as "StringIO", not "StringI" or "StringO".
2003-08-11typosSkip Montanaro-3/+3
2003-08-08SF bug #770485: cStringIO does not set closed attrRaymond Hettinger-2/+22
2003-04-24SF patch 695710: fix bug 678519: cStringIO self iteratorRaymond Hettinger-65/+56
(requested by GvR. patch contributed by Michael Stone)
2003-01-03SF patch 660559: Use METH_O and METH_NOARGS where possibleRaymond Hettinger-33/+19
Simplify code and speed access by using PyArg_UnpackTuple, METH_O and METH_NOARGS in three modules that can benefit from it.
2002-09-01SF bug 601775 - some int results that should be bool.Guido van Rossum-1/+2
2002-08-02Excise DL_EXPORT/DL_IMPORT from Modules/*. Required adding a prototypeMark Hammond-3/+3
for Py_Main(). Thanks to Kalle Svensson and Skip Montanaro for the patches.
2002-06-13Patch #568124: Add doc string macros.Martin v. Löwis-48/+35
2002-04-29See discussion at SF bug 547537.Guido van Rossum-1/+1
Unicode objects are currently taken as binary data by the write() method. This is not what Unicode users expect, nor what the StringIO.py code does. Until somebody adds a way to specify binary or text mode for cStringIO objects, change the format string to use "t#" instead of "s#", so that it will request the "text buffer" version. This will try the default encoding for Unicode objects. This is *not* a 2.2 bugfix (since it *is* a semantic change).
2002-04-04Removed old Digital Creations copyright/license notices (withGuido van Rossum-53/+0
permission from Paul Everitt). Also removed a few other references to Digital Creations and changed the remaining ones to Zope Corporation.
2002-03-08Fix SF bug #526518Jeremy Hylton-1/+1
The doc string for cStringIO suggested that str() of a StringIO object was equivalent to getvalue(). This was never true, so repair the doc string. (doctest would have helped here.) Bug fix candidate for any past versions.
2001-12-08Patch supplied by Burton Radons for his own SF bug #487390: ModifyingGuido van Rossum-2/+2
type.__module__ behavior. This adds the module name and a dot in front of the type name in every type object initializer, except for built-in types (and those that already had this). Note that it touches lots of Mac modules -- I have no way to test these but the changes look right. Apologies if they're not. This also touches the weakref docs, which contains a sample type object initializer. It also touches the mmap test output, because the mmap type's repr is included in that output. It touches object.h to put the correct description in a comment.
2001-12-07O_cwrite(): rewrote for clarity, replacing all the (Oobject *)selfGuido van Rossum-15/+16
casts with a variable oself that has the proper type. A smart compiler may put this thing into a register. (I'm not sure what good this does except satisfy my desire to understand this function; I got a report about an uninitialized read from Insure++ about this function and it hurt my eyes to even look at it. I gotta run away or I'll get tempted to reformat the entire file...)