summaryrefslogtreecommitdiffstats
path: root/Lib/csv.py
Commit message (Collapse)AuthorAgeFilesLines
* Patch #1635454: the csv.DictWriter class now includes the offendingGeorg Brandl2007-03-131-3/+4
| | | | | field names in its exception message if you try to write a record with a dictionary containing fields not in the CSV field names list.
* Fix a delimiter detection problem in sniffer. Sniffing "a|b|c\r\n" wasSkip Montanaro2005-12-301-3/+10
| | | | | | | | returning 'a' as the delimiter. It now returns '|', but not because I understood better what the code was supposed to do. Would someone that understands the idea behind _guess_delimiter() (see its doc string) look to see if my fallback choice is better than before or if it's just serendipity that I picked the proper delimiter?
* Fix for problem with Sniffer class. If your delimiter is whitespace and theSkip Montanaro2005-12-281-1/+1
| | | | | | last field was empty it would strip the delimiter and incorrectly guess that "" was the delimiter. Reported in c.l.py by Laurent Laporte. Will backport.
* Rename csv.set_field_limit to csv.field_size_limit (since it both sets andAndrew McNamara2005-01-121-1/+1
| | | | gets).
* Set an upper limit on the size of the field buffer, raise an exceptionAndrew McNamara2005-01-111-0/+1
| | | | | | | 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.
* Replace python-coded validation of csv dialect with a call to the CAndrew McNamara2005-01-111-40/+7
| | | | dialect type (which has a better idea of what is and isn't valid).
* Improved the implementation of the internal "dialect" type. The newAndrew McNamara2005-01-071-1/+1
| | | | | implementation features better error reporting, and better compliance with the PEP.
* add a couple missing docstringsSkip Montanaro2005-01-051-0/+9
|
* Make the fieldnames argument optional in the DictReader. If self.fieldnamesSkip Montanaro2003-10-031-1/+5
| | | | | | | | | is None, the next row read is used as the fieldnames. In the common case, this means the programmer doesn't need to know the fieldnames ahead of time. The first row of the file will be used. In the uncommon case, this means the programmer can set the reader's fieldnames attribute to None at any time and have the next row read as the next set of fieldnames, so a csv file can contain several "sections", each with different fieldnames.
* **kwds arg was missing from __init__ for Dict{Reader,Writer} classes.Skip Montanaro2003-09-061-4/+4
| | | | will backport.
* use the long names for re compilation options; this makes it easier toFred Drake2003-09-021-1/+1
| | | | figure out what the code is doing
* One more multiple exception catch should be in a tuple.Raymond Hettinger2003-06-121-1/+1
|
* The multiple exception catch should be in a tuple.Raymond Hettinger2003-06-121-1/+1
|
* SF Patch #744104: Remove eval() from csvRaymond Hettinger2003-06-121-17/+18
| | | | | | | | | | | Eliminates the eval() step in the csv module resulting in better security, more clarity, and a little speed. The idea is to make successive attempts to coerce the string to a python type: int(s), long(s), float(s), etc. As a by-product, eliminates a bare 'except' statement.
* * Correct Sniffer doc to correspond to the implementation.Skip Montanaro2003-05-191-7/+9
| | | | | * Add optional delimiters arg to Sniffer.sniff() which restricts the set of candidate field delimiters.
* rework Sniffer api significantlySkip Montanaro2003-04-251-41/+26
|
* Attempt to deal with some obvious errors in the code. These were allFred Drake2003-04-251-15/+14
| | | | | | | | | | due to using a single module-level namespace where multiple namespaces were used before. There *really* need to be tests for the sniffer stuff. This could have been avoided. Skip, please review, and add sniffer tests!
* cvs is going to be a module againSkip Montanaro2003-04-241-0/+440