summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_csv.py
Commit message (Collapse)AuthorAgeFilesLines
* gh-65496: Correct wording on csv's skipinitialspace argument (GH-96170)Miss Islington (bot)2022-10-071-0/+5
| | | | | (cherry picked from commit 676d8ef3806758bcd1d3fd84a746c8a9b64480d0) Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
* gh-95950: Add a test for both `csv.Dialect` and `kwargs` (GH-95951)Miss Islington (bot)2022-08-291-0/+28
| | | | | (cherry picked from commit 1c01bd28a0ec7e46e570a07d970c590b1809f8f1) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)Miss Islington (bot)2021-10-091-1/+30
| | | | | (cherry picked from commit 34bbc87b2ddbaf245fbed6443c3e620f80c6a843) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-43625: Enhance csv sniffer has_headers() to be more accurate (GH-26939) ↵Miss Islington (bot)2021-07-301-0/+36
| | | | | | | (GH-27494) (cherry picked from commit ceea579ccc51791f3e115155d6f27905bc7544a9) Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
* [3.10] bpo-44630: Fix assertion errors in csv module (GH-27127) (GH-27129)Miss Islington (bot)2021-07-131-0/+6
| | | | | | | | | | | | | | | | | | | Fix incorrect handling of exceptions when interpreting dialect objects in the csv module. Not clearing exceptions between calls to PyObject_GetAttrString() causes assertion failures in pydebug mode (or with assertions enabled). Add a minimal test that would've caught this (passing None as dialect, or any object that isn't a csv.Dialect subclass, which the csv module allows and caters to, even though it is not documented.) In pydebug mode, the test triggers the assertion failure in the old code. Contributed-By: T. Wouters [Google] (cherry picked from commit 0093876328afa330224c9d887c18dee0b3117852) Co-authored-by: T. Wouters <thomas@python.org> Automerge-Triggered-By: GH:gpshead
* bpo-28395: Remove unnecessary semicolons in tests (GH-26868)Miss Islington (bot)2021-06-231-1/+1
| | | | | (cherry picked from commit 5a3108044d2e5b694da2d1f4176c9bbaef15c142) Co-authored-by: Dong-hee Na <donghee.na@python.org>
* bpo-44089: Allow subclassing of ``csv.Error`` (GH-26008) (GH-26066)Miss Islington (bot)2021-05-121-0/+3
| | | | | | | | | | * fix subclass error * Update 2021-05-09-22-52-34.bpo-44089.IoANsN.rst (cherry picked from commit 2b458c1dba4058c808fde25226bb2d91c5a909ca) Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com> Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
* bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)Inada Naoki2021-04-041-28/+28
| | | | | | | | | | | | | | | | | | | * test_asyncio * test_bz2 * test_math * test_cmath * test_cmd_line * test_cmd_line_script * test_compile * test_contextlib * test_profile * ctypes/test/test_find * test_multiprocessing * test_configparser * test_csv * test_dbm_dumb * test_decimal * test_difflib * os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
* bpo-12178: Fix escaping of escapechar in csv.writer() (GH-13710)Berker Peksag2020-09-201-0/+14
| | | Co-authored-by: Itay Elbirt <anotahacou@gmail.com>
* bpo-41338: Fix DeprecationWarning in tests (GH-21542)Inada Naoki2020-07-201-0/+2
|
* bpo-36346: Make using the legacy Unicode C API optional (GH-21437)Serhiy Storchaka2020-07-101-1/+1
| | | | Add compile time option USE_UNICODE_WCHAR_CACHE. Setting it to 0 makes the interpreter not using the wchar_t cache and the legacy Unicode C API.
* bpo-26407: Do not mask errors in csv. (GH-20536)Serhiy Storchaka2020-06-221-1/+19
| | | | | Unexpected errors in calling the __iter__ method are no longer masked by TypeError in csv.reader(), csv.writer.writerow() and csv.writer.writerows().
* 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.