summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_csv.py
Commit message (Collapse)AuthorAgeFilesLines
* Sane humans would call these invalid tests, but Andrew McNamara pointed outSkip Montanaro2007-03-121-0/+4
| | | | | that given the inputs in these tests Excel does indeed produce the output these tests expect. Document that for future confused folks.
* ("Forward-port" of r46506)Armin Rigo2006-05-281-1/+4
| | | | | | | | | | | | | | Remove various dependencies on dictionary order in the standard library tests, and one (clearly an oversight, potentially critical) in the standard library itself - base64.py. Remaining open issues: * test_extcall is an output test, messy to make robust * tarfile.py has a potential bug here, but I'm not familiar enough with this code. Filed in as SF bug #1496501. * urllib2.HTTPPasswordMgr() returns a random result if there is more than one matching root path. I'm asking python-dev for clarification...
* Fix a delimiter detection problem in sniffer. Sniffing "a|b|c\r\n" wasSkip Montanaro2005-12-301-0/+7
| | | | | | | | 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/+4
| | | | | | 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.
* Fix tests dependent on the exception raised by non-settable descriptors.Barry Warsaw2005-04-201-2/+3
|
* Whitespace normalization.Tim Peters2005-01-131-7/+7
|
* Add counting of source iterator lines to the reader object - handy forAndrew McNamara2005-01-121-1/+13
| | | | | user error messages (otherwise difficult to do without instrumenting the source).
* When quoting=QUOTE_NONNUMERIC, the reader now casts unquoted fieldsAndrew McNamara2005-01-121-0/+6
| | | | to floats.
* Fix logic problem in quoting=csv.QUOTE_ALL, quotechar=None check, add test.Andrew McNamara2005-01-121-0/+2
|
* When using QUOTE_NONNUMERIC, we now test for "numericness" withAndrew McNamara2005-01-121-10/+20
| | | | | | | | 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-7/+7
| | | | gets).
* Improve test coverage fractionally.Andrew McNamara2005-01-121-9/+23
|
* Set an upper limit on the size of the field buffer, raise an exceptionAndrew McNamara2005-01-111-2/+9
| | | | | | | 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-4/+0
| | | | dialect type (which has a better idea of what is and isn't valid).
* No longer attempt to instantiate python classes describing dialects. ThisAndrew McNamara2005-01-111-18/+0
| | | | | | 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-1/+10
| | | | | record objects of internal dialect type, rather than instances of python objects.
* Fix parsing of csv files with escapes (escape character previously would beAndrew McNamara2005-01-101-2/+2
| | | | left in stream).
* Whitespace normalization.Tim Peters2005-01-071-1/+1
|
* Improved the implementation of the internal "dialect" type. The newAndrew McNamara2005-01-071-24/+99
| | | | | implementation features better error reporting, and better compliance with the PEP.
* Whitespace normalization.Tim Peters2004-07-081-3/+3
|
* Rewrote to use temporary files instead of StringIO objects in most places.Skip Montanaro2004-06-051-113/+253
| | | | Goal is to work in the direction of universal newline support.
* Make the fieldnames argument optional in the DictReader. If self.fieldnamesSkip Montanaro2003-10-031-1/+10
| | | | | | | | | 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-0/+7
| | | | will backport.
* add a couple test cases which involve longs and floats in 'e' format.Skip Montanaro2003-06-121-0/+23
|
* * Correct Sniffer doc to correspond to the implementation.Skip Montanaro2003-05-191-0/+15
| | | | | * Add optional delimiters arg to Sniffer.sniff() which restricts the set of candidate field delimiters.
* add not-yet-supported Unicode test just so it doesn't get lost.Skip Montanaro2003-05-061-0/+20
|
* Combine the functionality of test_support.run_unittest()Walter Dörwald2003-05-011-11/+7
| | | | | | | | | | and test_support.run_classtests() into run_unittest() and use it wherever possible. Also don't use "from test.test_support import ...", but "from test import test_support" in a few spots. From SF patch #662807.
* some sniffer testsSkip Montanaro2003-04-251-0/+34
|
* Whitespace normalization.Tim Peters2003-04-241-12/+12
|
* hoist contents of csv submodule up to the package levelSkip Montanaro2003-04-101-1/+1
|
* The message "*** skipping leakage tests ***" was causing the test toGuido van Rossum2003-03-211-1/+2
| | | | fail in a non-debug build. Only print this in verbose test mode.
* new CSV file processing module - see PEP 305Skip Montanaro2003-03-201-0/+619