summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_csv.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-27497: Add return value to csv.DictWriter.writeheader (GH-12306)Rémi Lapeyre2019-05-101-0/+6
| | | | | | csv.DictWriter.writeheader() now returns the return value of the underlying csv.Writer.writerow() method. Patch contributed by Ashish Nitin Patil.
* bpo-34197: Make _csv.Dialect attributes booleans. (GH-8440)Serhiy Storchaka2018-07-261-21/+19
| | | | Attributes skipinitialspace, doublequote and strict are now booleans instead of integers 0 or 1.
* bpo-30157: Fix csv.Sniffer.sniff() regex pattern. (GH-5601)Serhiy Storchaka2018-02-091-0/+10
| | | | Co-authored-by: Jake Davis <jcdavis@awedge.net>
* bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)Licht Takeuchi2017-12-121-1/+20
| | | This allows to distinguish an empty row from a row consisting of a single empty field.
* Issue #18219: Optimize csv.DictWriter for large number of columns.INADA Naoki2016-10-211-0/+18
| | | | Patch by Mariatta Wijaya.
* Issue #27895: Strengthen the dict reader tests.Raymond Hettinger2016-08-301-0/+38
|
* Issue #27842: The csv.DictReader now returns rows of type OrderedDict.Raymond Hettinger2016-08-301-0/+16
|
* Issue #23277: Remove unused imports in tests.Serhiy Storchaka2016-04-241-3/+0
|
* Issue #23277: Remove unused sys and os importsBerker Peksag2016-04-241-1/+0
| | | | Patch by Jon Dufresne.
* Issue #22995: Instances of extension types with a state that aren'tSerhiy Storchaka2015-12-251-0/+13
|\ | | | | | | | | | | subclasses of list or dict and haven't implemented any pickle-related methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or __getstate__), can no longer be pickled. Including memoryview.
| * Issue #22995: Instances of extension types with a state that aren'tSerhiy Storchaka2015-12-251-0/+13
| | | | | | | | | | | | subclasses of list or dict and haven't implemented any pickle-related methods (__reduce__, __reduce_ex__, __getnewargs__, __getnewargs_ex__, or __getstate__), can no longer be pickled. Including memoryview.
* | Issue #23883: Add missing APIs to __all__; patch by Jacek KołodziejMartin Panter2015-11-141-0/+6
|/
* Issue #21741: Update 147 test modules to use test discovery.Zachary Ware2015-04-131-7/+1
| | | | | | | I have compared output between pre- and post-patch runs of these tests to make sure there's nothing missing and nothing broken, on both Windows and Linux. The only differences I found were actually tests that were previously *not* run.
* Issue #23171: csv.Writer.writerow() now supports arbitrary iterables.Serhiy Storchaka2015-03-301-0/+8
|
* Check that failed writerow() doesn't produce change a file.Serhiy Storchaka2015-03-251-14/+16
|\
| * Check that failed writerow() doesn't produce change a file.Serhiy Storchaka2015-03-251-14/+16
| |
* | Issue #22076: Minor grammar fix.Berker Peksag2014-07-271-3/+3
| | | | | | | | Patch by Martin Matusiak.
* | Issue #18727: improve test coverage of the csv module by testing for ↵Antoine Pitrou2014-04-281-0/+10
|/ | | | | | DictWriter.writerows. Patch by Muhammad Jehanzeb.
* (Merge 3.3) Issue #18829: Add tests for the csv module for invalid charactersVictor Stinner2014-01-021-0/+14
|\ | | | | | | (delimiter, escapechar, quotechar)
| * Issue #18829: Add tests for the csv module for invalid characters (delimiter,Victor Stinner2014-01-021-0/+13
| | | | | | | | escapechar, quotechar)
* | Issue #18829: csv.Dialect() now checks type for delimiter, escapechar andSerhiy Storchaka2013-12-191-5/+39
|\ \ | |/ | | | | quotechar fields. Original patch by Vajrasky Kok.
| * Issue #18829: csv.Dialect() now checks type for delimiter, escapechar andSerhiy Storchaka2013-12-191-5/+39
| | | | | | | | quotechar fields. Original patch by Vajrasky Kok.
* | Merge: #19449: Handle non-string keys when generating 'fieldnames' error.R David Murray2013-11-191-0/+12
|\ \ | |/
| * #19449: Handle non-string keys when generating 'fieldnames' error.R David Murray2013-11-191-0/+12
| | | | | | | | | | | | | | csv was handling non-string keys fine except for the error message generated when a non-string key was not in 'fieldnames'. Fix by Tomas Grahn, full patch-with-test by Vajrasky Kok (tweaked slightly).
| * Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-72/+71
| |
* | Issue #18702: All skipped tests now reported as skipped.Serhiy Storchaka2013-11-031-72/+71
| |
* | Merge #18155: Regex-escape delimiter, in case it is a regex special char.R David Murray2013-06-291-3/+39
|\ \ | |/
| * #18155: Regex-escape delimiter, in case it is a regex special char.R David Murray2013-06-291-3/+39
| | | | | | | | Patch by Vajrasky Kok, with slight modification to the tests by me.
* | #15927: Fix cvs.reader parsing of escaped \r\n with quoting off.R David Murray2013-03-201-0/+9
| | | | | | | | | | | | | | This fix means that such values are correctly roundtripped, since cvs.writer already does the correct escaping. Patch by Michael Johnson.
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-6/+6
|/
* Issue #16145: Support legacy strings in the _csv module.Stefan Krah2012-11-021-0/+11
|
* Issue #16013: Fix CSV Reader parsing issue with ending quote characters. ↵Senthil Kumaran2012-09-251-0/+9
| | | | Patch by Serhiy Storchaka.
* Fix wrong test code in test_csv (#10602)Éric Araujo2010-12-021-12/+7
|
* #5975: add unix_dialect to csv module.Georg Brandl2010-10-271-0/+9
|
* Issue #9308: Removed redundant coding cookies. Added tests forAlexander Belopolsky2010-10-151-1/+0
| | | | | importing encoded modules that do not depend on specific stdlib modules being encoded in a certain way.
* Merged revisions ↵Georg Brandl2010-03-141-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 78018,78035-78040,78042-78043,78046,78048-78052,78054,78059,78075-78080 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r78018 | georg.brandl | 2010-02-06 11:08:21 +0100 (Sa, 06 Feb 2010) | 1 line #7864: make deprecation notices a bit clearer. ........ r78035 | georg.brandl | 2010-02-06 23:44:17 +0100 (Sa, 06 Feb 2010) | 1 line Fix duplicate import. ........ r78036 | georg.brandl | 2010-02-06 23:49:47 +0100 (Sa, 06 Feb 2010) | 1 line Remove unused import. ........ r78037 | georg.brandl | 2010-02-06 23:59:15 +0100 (Sa, 06 Feb 2010) | 1 line No need to assign the results of expressions used only for side effects. ........ r78038 | georg.brandl | 2010-02-07 00:02:29 +0100 (So, 07 Feb 2010) | 1 line Add a missing import. ........ r78039 | georg.brandl | 2010-02-07 00:06:24 +0100 (So, 07 Feb 2010) | 1 line Add missing imports. ........ r78040 | georg.brandl | 2010-02-07 00:08:00 +0100 (So, 07 Feb 2010) | 1 line Fix a few UnboundLocalErrors in test_long. ........ r78042 | georg.brandl | 2010-02-07 00:12:12 +0100 (So, 07 Feb 2010) | 1 line Add missing import. ........ r78043 | georg.brandl | 2010-02-07 00:12:19 +0100 (So, 07 Feb 2010) | 1 line Remove duplicate test method. ........ r78046 | georg.brandl | 2010-02-07 00:18:00 +0100 (So, 07 Feb 2010) | 1 line Fix various missing import/unbound name errors. ........ r78048 | georg.brandl | 2010-02-07 00:23:45 +0100 (So, 07 Feb 2010) | 1 line We heard you like test failures so we put unbound locals in your test so that you can fail while you fail. ........ r78049 | georg.brandl | 2010-02-07 00:33:33 +0100 (So, 07 Feb 2010) | 1 line Fix import/access for some identifiers. _TestSharedCTypes does not seem to be executed? ........ r78050 | georg.brandl | 2010-02-07 00:34:10 +0100 (So, 07 Feb 2010) | 1 line Fix more unbound locals in code paths that do not seem to be used. ........ r78051 | georg.brandl | 2010-02-07 00:53:52 +0100 (So, 07 Feb 2010) | 1 line Add missing import when running these tests standalone. ........ r78052 | georg.brandl | 2010-02-07 00:54:04 +0100 (So, 07 Feb 2010) | 1 line Add missing import when running these tests standalone. ........ r78054 | georg.brandl | 2010-02-07 00:58:25 +0100 (So, 07 Feb 2010) | 1 line Add missing import. ........ r78059 | georg.brandl | 2010-02-07 12:34:15 +0100 (So, 07 Feb 2010) | 1 line Use "regexp" consistently. ........ r78075 | georg.brandl | 2010-02-07 13:16:12 +0100 (So, 07 Feb 2010) | 1 line Fix another duplicated test method. ........ r78076 | georg.brandl | 2010-02-07 13:19:43 +0100 (So, 07 Feb 2010) | 1 line Fix wrong usage of "except X, Y:". ........ r78077 | georg.brandl | 2010-02-07 13:25:50 +0100 (So, 07 Feb 2010) | 1 line Fix two redefined test methods. ........ r78078 | georg.brandl | 2010-02-07 13:27:06 +0100 (So, 07 Feb 2010) | 1 line Fix a redefined test method. ........ r78079 | georg.brandl | 2010-02-07 13:34:26 +0100 (So, 07 Feb 2010) | 1 line Add a minimal test for fnmatchcase(). ........ r78080 | georg.brandl | 2010-02-07 13:55:12 +0100 (So, 07 Feb 2010) | 1 line Remove duplicate test method. ........
* Merged revisions 78384 via svnmerge fromR. David Murray2010-02-231-0/+4
| | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78384 | dirkjan.ochtman | 2010-02-23 16:09:52 -0500 (Tue, 23 Feb 2010) | 4 lines Fix #1537721: add writeheader() method to csv.DictWriter. Reviewed by skip.montanaro and thomas.wouters. ........
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-1/+1
| | | | A patch from Dave Malcolm.
* Merged revisions ↵Benjamin Peterson2009-10-041-1/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 74779-74786,74793,74795,74811,74860-74861,74863,74876,74886,74896,74901,74903,74908,74912,74930,74933,74943,74946,74952-74955,75015,75019,75032,75068,75076,75095,75098,75102,75129,75139,75230 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r74779 | michael.foord | 2009-09-13 11:13:36 -0500 (Sun, 13 Sep 2009) | 1 line Change to tutorial wording for reading text / binary files on Windows. Issue #6301. ........ r74780 | michael.foord | 2009-09-13 11:40:02 -0500 (Sun, 13 Sep 2009) | 1 line Objects that compare equal automatically pass or fail assertAlmostEqual and assertNotAlmostEqual tests on unittest.TestCase. Issue 6567. ........ r74781 | michael.foord | 2009-09-13 11:46:19 -0500 (Sun, 13 Sep 2009) | 1 line Note that sys._getframe is not guaranteed to exist in all implementations of Python, and a corresponding note in inspect.currentframe. Issue 6712. ........ r74782 | michael.foord | 2009-09-13 12:07:46 -0500 (Sun, 13 Sep 2009) | 1 line Tutorial tweaks. Issue 6849. ........ r74783 | michael.foord | 2009-09-13 12:28:35 -0500 (Sun, 13 Sep 2009) | 1 line unittest.TestLoader.loadTestsFromName honors the loader suiteClass attribute. Issue 6866. ........ r74784 | georg.brandl | 2009-09-13 13:15:07 -0500 (Sun, 13 Sep 2009) | 1 line Typo fix. ........ r74785 | michael.foord | 2009-09-13 14:07:03 -0500 (Sun, 13 Sep 2009) | 1 line Test discovery in unittest will only attempt to import modules that are importable; i.e. their names are valid Python identifiers. If an import fails during discovery this will be recorded as an error and test discovery will continue. Issue 6568. ........ r74786 | michael.foord | 2009-09-13 14:08:18 -0500 (Sun, 13 Sep 2009) | 1 line Remove an extraneous space in unittest documentation. ........ r74793 | georg.brandl | 2009-09-14 09:50:47 -0500 (Mon, 14 Sep 2009) | 1 line #6908: fix association of hashlib hash attributes. ........ r74795 | benjamin.peterson | 2009-09-14 22:36:26 -0500 (Mon, 14 Sep 2009) | 1 line Py_SetPythonHome uses static storage #6913 ........ r74811 | georg.brandl | 2009-09-15 15:26:59 -0500 (Tue, 15 Sep 2009) | 1 line Add Armin Ronacher. ........ r74860 | benjamin.peterson | 2009-09-16 21:46:54 -0500 (Wed, 16 Sep 2009) | 1 line kill bare except ........ r74861 | benjamin.peterson | 2009-09-16 22:18:28 -0500 (Wed, 16 Sep 2009) | 1 line pep 8 defaults ........ r74863 | benjamin.peterson | 2009-09-16 22:27:33 -0500 (Wed, 16 Sep 2009) | 1 line rationalize a bit ........ r74876 | georg.brandl | 2009-09-17 11:15:53 -0500 (Thu, 17 Sep 2009) | 1 line #6932: remove paragraph that advises relying on __del__ being called. ........ r74886 | benjamin.peterson | 2009-09-17 16:33:46 -0500 (Thu, 17 Sep 2009) | 1 line use macros ........ r74896 | georg.brandl | 2009-09-18 02:22:41 -0500 (Fri, 18 Sep 2009) | 1 line #6936: for interactive use, quit() is just fine. ........ r74901 | georg.brandl | 2009-09-18 04:14:52 -0500 (Fri, 18 Sep 2009) | 1 line #6905: use better exception messages in inspect when the argument is of the wrong type. ........ r74903 | georg.brandl | 2009-09-18 04:18:27 -0500 (Fri, 18 Sep 2009) | 1 line #6938: "ident" is always a string, so use a format code which works. ........ r74908 | georg.brandl | 2009-09-18 08:57:11 -0500 (Fri, 18 Sep 2009) | 1 line Use str.format() to fix beginner's mistake with %-style string formatting. ........ r74912 | georg.brandl | 2009-09-18 11:19:56 -0500 (Fri, 18 Sep 2009) | 1 line Optimize optimization and fix method name in docstring. ........ r74930 | georg.brandl | 2009-09-18 16:21:41 -0500 (Fri, 18 Sep 2009) | 1 line #6925: rewrite docs for locals() and vars() a bit. ........ r74933 | georg.brandl | 2009-09-18 16:35:59 -0500 (Fri, 18 Sep 2009) | 1 line #6930: clarify description about byteorder handling in UTF decoder routines. ........ r74943 | georg.brandl | 2009-09-19 02:35:07 -0500 (Sat, 19 Sep 2009) | 1 line #6944: the argument to PyArg_ParseTuple should be a tuple, otherwise a SystemError is set. Also clean up another usage of PyArg_ParseTuple. ........ r74946 | georg.brandl | 2009-09-19 03:43:16 -0500 (Sat, 19 Sep 2009) | 1 line Update bug tracker reference. ........ r74952 | georg.brandl | 2009-09-19 05:42:34 -0500 (Sat, 19 Sep 2009) | 1 line #6946: fix duplicate index entries for datetime classes. ........ r74953 | georg.brandl | 2009-09-19 07:04:16 -0500 (Sat, 19 Sep 2009) | 1 line Fix references to threading.enumerate(). ........ r74954 | georg.brandl | 2009-09-19 08:13:56 -0500 (Sat, 19 Sep 2009) | 1 line Add Doug. ........ r74955 | georg.brandl | 2009-09-19 08:20:49 -0500 (Sat, 19 Sep 2009) | 1 line Add Mark Summerfield. ........ r75015 | georg.brandl | 2009-09-22 05:55:08 -0500 (Tue, 22 Sep 2009) | 1 line Fix encoding name. ........ r75019 | vinay.sajip | 2009-09-22 12:23:41 -0500 (Tue, 22 Sep 2009) | 1 line Fixed a typo, and added sections on optimization and using arbitrary objects as messages. ........ r75032 | benjamin.peterson | 2009-09-22 17:15:28 -0500 (Tue, 22 Sep 2009) | 1 line fix typos/rephrase ........ r75068 | benjamin.peterson | 2009-09-25 21:57:59 -0500 (Fri, 25 Sep 2009) | 1 line comment out ugly xxx ........ r75076 | vinay.sajip | 2009-09-26 09:53:32 -0500 (Sat, 26 Sep 2009) | 1 line Tidied up name of parameter in StreamHandler ........ r75095 | michael.foord | 2009-09-27 14:15:41 -0500 (Sun, 27 Sep 2009) | 1 line Test creation moved from TestProgram.parseArgs to TestProgram.createTests exclusively. Issue 6956. ........ r75098 | michael.foord | 2009-09-27 15:08:23 -0500 (Sun, 27 Sep 2009) | 1 line Documentation improvement for load_tests protocol in unittest. Issue 6515. ........ r75102 | skip.montanaro | 2009-09-27 21:12:27 -0500 (Sun, 27 Sep 2009) | 3 lines Patch from Thomas Barr so that csv.Sniffer will set doublequote property. Closes issue 6606. ........ r75129 | vinay.sajip | 2009-09-29 02:08:54 -0500 (Tue, 29 Sep 2009) | 1 line Issue #7014: logging: Improved IronPython 2.6 compatibility. ........ r75139 | raymond.hettinger | 2009-09-29 13:53:24 -0500 (Tue, 29 Sep 2009) | 3 lines Issue 7008: Better document str.title and show how to work around the apostrophe problem. ........ r75230 | benjamin.peterson | 2009-10-04 08:38:38 -0500 (Sun, 04 Oct 2009) | 1 line test logging ........
* convert old fail* assertions to assert*Benjamin Peterson2009-06-301-4/+4
|
* Update documentation for csv module to reflect changes in code,R. David Murray2009-04-041-1/+1
| | | | | | | | | | specifically that it now expects unicode input (and therefore the paragraph about it not handling unicode is deleted, as well as the 'how to handle unicode' examples) and that files should be opened with "newline=''" instead of binary mode. Also removed unused BytesIO import from test_csv. This addresses issue 4847.
* Merged revisions 70997 via svnmerge fromR. David Murray2009-04-011-0/+13
| | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r70997 | r.david.murray | 2009-04-01 17:26:18 -0400 (Wed, 01 Apr 2009) | 3 lines Add tests checking the CSV module's ability to handle embedded newlines in quoted field values. ........
* Merged revisions 65605 via svnmerge fromSkip Montanaro2008-08-091-0/+24
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r65605 | skip.montanaro | 2008-08-08 17:52:51 -0500 (Fri, 08 Aug 2008) | 1 line accept issue 3436 ........
* #2621 rename test.test_support to test.supportBenjamin Peterson2008-05-201-3/+3
|
* Correct test_cvs on Windows, as suggested by Raghuram DevarakondaAmaury Forgeot d'Arc2007-11-191-2/+6
| | | | | | in issue1395. All other places in this file already use newline=''... Also check that csv.reader is given an iterable returning strings.
* Patch # 1033 by Adam Hupp:Guido van Rossum2007-08-281-26/+25
| | | | | | | 1) tempfile.TemporaryFile, NamedTemporaryFile, and SpooledTemporaryFile now pass newline and encoding to the underlying io.open call. 2) test_tempfile is updated 3) test_csv is updated to use the new arguments.
* Remove string.{letters,lowercase,uppercase}.Martin v. Löwis2007-08-141-1/+1
|
* SF patch# 1770008 by Christian Heimes (plus some extras).Guido van Rossum2007-08-091-1/+1
| | | | | | | | | | Completely get rid of StringIO.py and cStringIO.c. I had to fix a few tests and modules beyond what Christian did, and invent a few conventions. E.g. in elementtree, I chose to write/return Unicode strings whe no encoding is given, but bytes when an explicit encoding is given. Also mimetools was made to always assume binary files.
* SF patch# 1767398 by Adam Hupp.Guido van Rossum2007-08-061-174/+75
| | | | | Fix csv to read/write bytes from/to binary files. Fix the unit tests to test this and to use with TemporaryFile().
* Change a bunch of file encodings from Latin-1 to UTF-8.Guido van Rossum2007-07-161-8/+8
| | | | | | | Remove the encoding from Tix.py (it doesn't seem to need one). Note: we still have to keep the "coding: utf-8" declaration for files that aren't pure ASCII, as the default per PEP 3120 hasn't been implemented yet.