summaryrefslogtreecommitdiff
path: root/Modules/_csv.c
AgeCommit message (Collapse)AuthorLines
2019-06-18[2.7] Fix name of '\0'. (GH-14225)Benjamin Peterson-1/+1
'\0' is the NUL byte not NULL.. (cherry picked from commit 7821b4c6d29933511d50bb42255e39790c6abf00)
2018-08-17bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Realloc(). ↵Sergey Fedoseev-32/+24
(GH-8785)
2018-07-31[2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)Serhiy Storchaka-2/+2
2016-12-27Issue #28998: More APIs now support longs as well as ints.Serhiy Storchaka-5/+12
2016-08-13check for overflow in join_append_data (closes #27758)Benjamin Peterson-4/+19
Reported by Thomas E. Hybel
2016-04-17Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka-1/+1
2016-04-06Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka-2/+2
2015-12-24Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka-4/+2
macro Py_SETREF.
2015-10-02Issue #25290: Fix typo in csv.reader() docstringBerker Peksag-1/+1
Patch by Johannes Niediek.
2013-12-19Issue #18829: csv.Dialect() now checks type for delimiter, escapechar andSerhiy Storchaka-14/+20
quotechar fields. Original patch by Vajrasky Kok.
2012-09-252.7 : Issue #16013: Fix CSV Reader parsing issue with ending quote ↵Senthil Kumaran-3/+7
characters. Patch by Serhiy Storchaka.
2012-08-15Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵Antoine Pitrou-2/+6
errors correctly. Patch by Serhiy Storchaka.
2011-12-11Issue #13573: The csv.writer now uses the repr() for floats rather than str().Raymond Hettinger-1/+5
2010-05-09Untabify C files. Will watch buildbots.Antoine Pitrou-1030/+1030
2008-06-11Merge in release25-maint r60793:Gregory P. Smith-0/+10
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-14/+14
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-14/+14
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-07-21PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis-8/+5
backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
2006-05-10Fix problems found by Coverity.Neal Norwitz-0/+2
longobject.c: also fix an ssize_t problem <a> could have been NULL, so hoist the size calc to not use <a>. _ssl.c: under fail: self is DECREF'd, but it would have been NULL. _elementtree.c: delete self if there was an error. _csv.c: I'm not sure if lineterminator could have been anything other than a string. However, other string method calls are checked, so check this one too.
2006-04-15Use Py_VISIT in all tp_traverse methods, instead of traversing manually orThomas Wouters-20/+15
using a custom, nearly-identical macro. This probably changes how some of these functions are compiled, which may result in fractionally slower (or faster) execution. Considering the nature of traversal, visiting much of the address space in unpredictable patterns, I'd argue the code readability and maintainability is well worth it ;P
2006-04-15Remove partial change (don't edit, commit and think at the same time :P)Thomas Wouters-1/+0
2006-04-15Re-instate backward compatibility by defining Py_CLEAR if it isn'tThomas Wouters-0/+14
available.
2006-04-15Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, forThomas Wouters-10/+5
tp_clear methods.
2006-04-04docstring tweakFredrik Lundh-1/+1
2006-02-27More unconsting.Martin v. Löwis-1/+1
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-06-15Michael Hudson pointed out that the Dialect_Type object isn't INCREF'd. WhySkip Montanaro-0/+1
this worked is a bit mystical. Perhaps it never gets freed because the object just happens never to be DECREF'd (but that seems unlikely).
2005-06-15Leak fix from Michael Hudson. Fix memory leak when dialect doesn'tSkip Montanaro-0/+2
validate. Closes 1220242.
2005-01-13Moved reader \r and \n processing from the iterator to the state machine -Andrew McNamara-97/+75
this allows for better handling of newline characters in quoted fields (and hopefully resolves Bug 967934).
2005-01-12Improve wording of parser error message.Andrew McNamara-2/+2
2005-01-12Add counting of source iterator lines to the reader object - handy forAndrew McNamara-0/+4
user error messages (otherwise difficult to do without instrumenting the source).
2005-01-12When quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fieldsAndrew McNamara-30/+59
to floats.
2005-01-12Fix logic problem in quoting=csv.QUOTE_ALL, quotechar=None check, add test.Andrew McNamara-1/+1
2005-01-12When using QUOTE_NONNUMERIC, we now test for "numericness" withAndrew McNamara-82/+58
PyNumber_Check, rather than trying to convert to a float. Reimplemented writer - now raises exceptions when it sees a quotechar but neither doublequote or escapechar are set. Doublequote results are now more consistent (eg, single quote should generate """", rather than "", which is ambiguous).
2005-01-12Rename csv.set_field_limit to csv.field_size_limit (since it both sets andAndrew McNamara-6/+6
gets).
2005-01-12Add belt and braces check of PyString_AsString return.Andrew McNamara-4/+5
2005-01-11Set an upper limit on the size of the field buffer, raise an exceptionAndrew McNamara-30/+77
when this limit is reached. Limit defaults to 128k, and is changed by module set_field_limit() method. Previously, an unmatched quote character could result in the entire file being read into the field buffer, potentially exhausting virtual memory.
2005-01-11Now that internal dialect type is immutable, and the dialect registryAndrew McNamara-29/+40
only contains instances of the dialect type, we can refer directly to the dialect instances rather than creating new ones. In other words, if the dialect comes from the registry, and we apply no further modifications, the reader/writer can use the dialect object directly.
2005-01-11No longer attempt to instantiate python classes describing dialects. ThisAndrew McNamara-37/+6
was done because we were previously performing validation of the dialect from python, but this is now down within the C module. Also, the method we were using to detect classes did not work with new-style classes.
2005-01-11Allow dialect-describing keywords to be supplied to register_dialect,Andrew McNamara-27/+11
record objects of internal dialect type, rather than instances of python objects.
2005-01-11Factor out the code for making a dialect instance.Andrew McNamara-18/+22
2005-01-10Only set error string when dict lookup found no matching key (was settingAndrew McNamara-3/+6
it for all failures, potentially masking other exceptions).
2005-01-10When parsing args that return a single character, treat null string theAndrew McNamara-1/+1
same as None.
2005-01-10Where a string is desired, test for PyBaseString_Type derived type,Andrew McNamara-15/+6
rather than using PyString_Check/PyUnicode_Check.
2005-01-10Add missing PyObject_GC_Track and PyObject_GC_UnTrack calls to csv reader andAndrew McNamara-0/+4
writer objects (other GC infrastructure already in place).
2005-01-10Fix parsing of csv files with escapes (escape character previously would beAndrew McNamara-8/+0
left in stream).
2005-01-07Fix to use PEP7 brace style.Andrew McNamara-2/+4
2005-01-07Improved the implementation of the internal "dialect" type. The newAndrew McNamara-185/+237
implementation features better error reporting, and better compliance with the PEP.
2005-01-06Delete Reader_getiter and replace with PyObject_SelfIter.Andrew McNamara-8/+1