summaryrefslogtreecommitdiffstats
path: root/Modules/_csv.c
Commit message (Collapse)AuthorAgeFilesLines
* [2.7] Fix name of '\0'. (GH-14225)Benjamin Peterson2019-06-191-1/+1
| | | | '\0' is the NUL byte not NULL.. (cherry picked from commit 7821b4c6d29933511d50bb42255e39790c6abf00)
* bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Realloc(). ↵Sergey Fedoseev2018-08-171-32/+24
| | | | (GH-8785)
* [2.7] bpo-34234: Use _PyAnyInt_Check() and _PyAnyInt_CheckExact(). (GH-8479)Serhiy Storchaka2018-07-311-2/+2
|
* Issue #28998: More APIs now support longs as well as ints.Serhiy Storchaka2016-12-271-5/+12
|
* check for overflow in join_append_data (closes #27758)Benjamin Peterson2016-08-141-4/+19
| | | | Reported by Thomas E. Hybel
* Issue #26778: Fixed "a/an/and" typos in code comment and documentation.Serhiy Storchaka2016-04-171-1/+1
|
* Issue #22570: Renamed Py_SETREF to Py_XSETREF.Serhiy Storchaka2016-04-061-2/+2
|
* Issue #20440: Massive replacing unsafe attribute setting code with specialSerhiy Storchaka2015-12-241-4/+2
| | | | macro Py_SETREF.
* Issue #25290: Fix typo in csv.reader() docstringBerker Peksag2015-10-021-1/+1
| | | | Patch by Johannes Niediek.
* Issue #18829: csv.Dialect() now checks type for delimiter, escapechar andSerhiy Storchaka2013-12-191-14/+20
| | | | quotechar fields. Original patch by Vajrasky Kok.
* 2.7 : Issue #16013: Fix CSV Reader parsing issue with ending quote ↵Senthil Kumaran2012-09-251-3/+7
| | | | characters. Patch by Serhiy Storchaka.
* Issue #15604: Update uses of PyObject_IsTrue() to check for and handle ↵Antoine Pitrou2012-08-151-2/+6
| | | | | | errors correctly. Patch by Serhiy Storchaka.
* Issue #13573: The csv.writer now uses the repr() for floats rather than str().Raymond Hettinger2011-12-121-1/+5
|
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-1094/+1094
|
* Merge in release25-maint r60793:Gregory P. Smith2008-06-111-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.
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-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.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-14/+14
|
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-2/+2
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-8/+5
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Fix problems found by Coverity.Neal Norwitz2006-05-101-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.
* Use Py_VISIT in all tp_traverse methods, instead of traversing manually orThomas Wouters2006-04-151-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
* Remove partial change (don't edit, commit and think at the same time :P)Thomas Wouters2006-04-151-1/+0
|
* Re-instate backward compatibility by defining Py_CLEAR if it isn'tThomas Wouters2006-04-151-0/+14
| | | | available.
* Use Py_CLEAR instead of in-place DECREF/XDECREF or custom macros, forThomas Wouters2006-04-151-10/+5
| | | | tp_clear methods.
* docstring tweakFredrik Lundh2006-04-041-1/+1
|
* More unconsting.Martin v. Löwis2006-02-271-1/+1
|
* Add const to several API functions that take char *.Jeremy Hylton2005-12-101-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 *.
* Michael Hudson pointed out that the Dialect_Type object isn't INCREF'd. WhySkip Montanaro2005-06-151-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).
* Leak fix from Michael Hudson. Fix memory leak when dialect doesn'tSkip Montanaro2005-06-151-0/+2
| | | | validate. Closes 1220242.
* Moved reader \r and \n processing from the iterator to the state machine -Andrew McNamara2005-01-131-97/+75
| | | | | this allows for better handling of newline characters in quoted fields (and hopefully resolves Bug 967934).
* Improve wording of parser error message.Andrew McNamara2005-01-121-2/+2
|
* Add counting of source iterator lines to the reader object - handy forAndrew McNamara2005-01-121-0/+4
| | | | | user error messages (otherwise difficult to do without instrumenting the source).
* When quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fieldsAndrew McNamara2005-01-121-30/+59
| | | | to floats.
* Fix logic problem in quoting=csv.QUOTE_ALL, quotechar=None check, add test.Andrew McNamara2005-01-121-1/+1
|
* When using QUOTE_NONNUMERIC, we now test for "numericness" withAndrew McNamara2005-01-121-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).
* Rename csv.set_field_limit to csv.field_size_limit (since it both sets andAndrew McNamara2005-01-121-6/+6
| | | | gets).
* Add belt and braces check of PyString_AsString return.Andrew McNamara2005-01-121-4/+5
|
* Set an upper limit on the size of the field buffer, raise an exceptionAndrew McNamara2005-01-111-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.
* Now that internal dialect type is immutable, and the dialect registryAndrew McNamara2005-01-111-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.
* No longer attempt to instantiate python classes describing dialects. ThisAndrew McNamara2005-01-111-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.
* Allow dialect-describing keywords to be supplied to register_dialect,Andrew McNamara2005-01-111-27/+11
| | | | | record objects of internal dialect type, rather than instances of python objects.
* Factor out the code for making a dialect instance.Andrew McNamara2005-01-111-18/+22
|
* Only set error string when dict lookup found no matching key (was settingAndrew McNamara2005-01-101-3/+6
| | | | it for all failures, potentially masking other exceptions).
* When parsing args that return a single character, treat null string theAndrew McNamara2005-01-101-1/+1
| | | | same as None.
* Where a string is desired, test for PyBaseString_Type derived type,Andrew McNamara2005-01-101-15/+6
| | | | rather than using PyString_Check/PyUnicode_Check.
* Add missing PyObject_GC_Track and PyObject_GC_UnTrack calls to csv reader andAndrew McNamara2005-01-101-0/+4
| | | | writer objects (other GC infrastructure already in place).
* Fix parsing of csv files with escapes (escape character previously would beAndrew McNamara2005-01-101-8/+0
| | | | left in stream).
* Fix to use PEP7 brace style.Andrew McNamara2005-01-071-2/+4
|
* Improved the implementation of the internal "dialect" type. The newAndrew McNamara2005-01-071-187/+239
| | | | | implementation features better error reporting, and better compliance with the PEP.
* Delete Reader_getiter and replace with PyObject_SelfIter.Andrew McNamara2005-01-061-8/+1
|