summaryrefslogtreecommitdiffstats
path: root/Modules/_csv.c
Commit message (Collapse)AuthorAgeFilesLines
* gh-65496: Correct wording on csv's skipinitialspace argument (#96170)Stanley2022-10-071-4/+4
|
* gh-89653: Use int type for Unicode kind (#92704)Victor Stinner2022-05-131-4/+4
| | | | Use the same type that PyUnicode_FromKindAndData() kind parameter type (public C API): int.
* gh-91320: Use _PyCFunction_CAST() (#92251)Victor Stinner2022-05-031-3/+3
| | | | | | | | | | Replace "(PyCFunction)(void(*)(void))func" cast with _PyCFunction_CAST(func). Change generated by the command: sed -i -e \ 's!(PyCFunction)(void(\*)(void)) *\([A-Za-z0-9_]\+\)!_PyCFunction_CAST(\1)!g' \ $(find -name "*.c")
* bpo-40676: Use Argument Clinic for csv (where possible) (GH-20200)Shantanu2022-04-161-37/+63
|
* bpo-46541: Remove unnecessary Py_VISIT (GH-31608)Dong-hee Na2022-02-281-1/+0
|
* bpo-46541: Remove usage of _Py_IDENTIFIER from csv module (GH-31372)Dong-hee Na2022-02-161-4/+10
|
* bpo-46613: Add PyType_GetModuleByDef to the public API (GH-31081)Petr Viktorin2022-02-111-1/+1
| | | | | * Make PyType_GetModuleByDef public (remove underscore) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-46541: Replace core use of _Py_IDENTIFIER() with statically initialized ↵Eric Snow2022-02-081-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | global objects. (gh-30928) We're no longer using _Py_IDENTIFIER() (or _Py_static_string()) in any core CPython code. It is still used in a number of non-builtin stdlib modules. The replacement is: PyUnicodeObject (not pointer) fields under _PyRuntimeState, statically initialized as part of _PyRuntime. A new _Py_GET_GLOBAL_IDENTIFIER() macro facilitates lookup of the fields (along with _Py_GET_GLOBAL_STRING() for non-identifier strings). https://bugs.python.org/issue46541#msg411799 explains the rationale for this change. The core of the change is in: * (new) Include/internal/pycore_global_strings.h - the declarations for the global strings, along with the macros * Include/internal/pycore_runtime_init.h - added the static initializers for the global strings * Include/internal/pycore_global_objects.h - where the struct in pycore_global_strings.h is hooked into _PyRuntimeState * Tools/scripts/generate_global_objects.py - added generation of the global string declarations and static initializers I've also added a --check flag to generate_global_objects.py (along with make check-global-objects) to check for unused global strings. That check is added to the PR CI config. The remainder of this change updates the core code to use _Py_GET_GLOBAL_IDENTIFIER() instead of _Py_IDENTIFIER() and the related _Py*Id functions (likewise for _Py_GET_GLOBAL_STRING() instead of _Py_static_string()). This includes adding a few functions where there wasn't already an alternative to _Py*Id(), replacing the _Py_Identifier * parameter with PyObject *. The following are not changed (yet): * stop using _Py_IDENTIFIER() in the stdlib modules * (maybe) get rid of _Py_IDENTIFIER(), etc. entirely -- this may not be doable as at least one package on PyPI using this (private) API * (maybe) intern the strings during runtime init https://bugs.python.org/issue46541
* bpo-20028: Empty escapechar/quotechar is not allowed for csv.Dialect (GH-28833)Dong-hee Na2021-10-111-9/+4
|
* bpo-27580: Add support of null characters in the csv module. (GH-28808)Serhiy Storchaka2021-10-091-33/+30
|
* bpo-20028: Keep original exception when PyUnicode_GetLength return -1 (GH-28832)Dong-hee Na2021-10-091-0/+6
|
* bpo-20028: Improve error message of csv.Dialect when initializing (GH-28705)Dong-hee Na2021-10-091-8/+38
|
* Fix typos in the Modules directory (GH-28761)Christian Clauss2021-10-071-1/+1
|
* bpo-44630: Fix assertion errors in csv module (GH-27127)T. Wouters2021-07-131-4/+8
| | | | | | | | | | | | | 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]
* bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)Erlend Egeberg Aasland2021-06-171-3/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Make functools types immutable * Multibyte codec types are now immutable * pyexpat.xmlparser is now immutable * array.arrayiterator is now immutable * _thread types are now immutable * _csv types are now immutable * _queue.SimpleQueue is now immutable * mmap.mmap is now immutable * unicodedata.UCD is now immutable * sqlite3 types are now immutable * _lsprof.Profiler is now immutable * _overlapped.Overlapped is now immutable * _operator types are now immutable * winapi__overlapped.Overlapped is now immutable * _lzma types are now immutable * _bz2 types are now immutable * _dbm.dbm and _gdbm.gdbm are now immutable
* bpo-44116: Add GC support to _csv heap types (GH-26074)Erlend Egeberg Aasland2021-05-121-30/+32
|
* bpo-44089: Allow subclassing of ``csv.Error`` (GH-26008)Ken Jin2021-05-121-1/+1
| | | | | * fix subclass error * Update 2021-05-09-22-52-34.bpo-44089.IoANsN.rst
* bpo-14935: Remove static state from the _csv module (GH-23224)Petr Viktorin2020-12-151-241/+303
| | | | | | | | Uses code from: https://github.com/python/cpython/pull/16078 Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com> Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com> Co-authored-by: Hai Shi <shihai1992@gmail.com>
* bpo-12178: Fix escaping of escapechar in csv.writer() (GH-13710)Berker Peksag2020-09-201-0/+3
| | | Co-authored-by: Itay Elbirt <anotahacou@gmail.com>
* bpo-26407: Do not mask errors in csv. (GH-20536)Serhiy Storchaka2020-06-221-8/+8
| | | | | Unexpected errors in calling the __iter__ method are no longer masked by TypeError in csv.reader(), csv.writer.writerow() and csv.writer.writerows().
* Remove usesless function from csv module (GH-20762)Dong-hee Na2020-06-091-8/+2
|
* bpo-40876: Clarify error message in the csv module (GH-20653)Ram Rachum2020-06-051-1/+1
|
* Remove unused ReaderObject_Check macro (#20614)Dong-hee Na2020-06-031-2/+0
|
* bpo-40268: Remove unused structmember.h includes (GH-19530)Victor Stinner2020-04-151-1/+1
| | | | | | If only offsetof() is needed: include stddef.h instead. When structmember.h is used, add a comment explaining that PyMemberDef is used.
* bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode ↵Serhiy Storchaka2020-04-111-4/+4
| | | | data. (GH-19345)
* bpo-40024: Update C extension modules to use PyModule_AddType() (GH-19119)Dong-hee Na2020-03-241-6/+2
| | | | | | Update _asyncio, _bz2, _csv, _curses, _datetime, _io, _operator, _pickle, _queue, blake2, multibytecodec and overlapped C extension modules to use PyModule_AddType().
* bpo-39968: Convert extension modules' macros of get_module_state() to inline ↵Hai Shi2020-03-161-14/+20
| | | | functions (GH-19017)
* bpo-39573: Clean up modules and headers to use Py_IS_TYPE() function (GH-18521)Dong-hee Na2020-02-171-1/+1
|
* bpo-39245: Switch to public API for Vectorcall (GH-18460)Petr Viktorin2020-02-111-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | The bulk of this patch was generated automatically with: for name in \ PyObject_Vectorcall \ Py_TPFLAGS_HAVE_VECTORCALL \ PyObject_VectorcallMethod \ PyVectorcall_Function \ PyObject_CallOneArg \ PyObject_CallMethodNoArgs \ PyObject_CallMethodOneArg \ ; do echo $name git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g" done old=_PyObject_FastCallDict new=PyObject_VectorcallDict git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g" and then cleaned up: - Revert changes to in docs & news - Revert changes to backcompat defines in headers - Nudge misaligned comments
* bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)Victor Stinner2020-02-071-3/+3
| | | Replace direct access to PyObject.ob_type with Py_TYPE().
* bpo-37994: Fix silencing all errors if an attribute lookup fails. (GH-15630)Serhiy Storchaka2019-09-011-1/+4
| | | Only AttributeError should be silenced.
* bpo-37483: add _PyObject_CallOneArg() function (#14558)Jeroen Demeyer2019-07-041-1/+1
|
* Fix name of '\0'. (GH-14222)Benjamin Peterson2019-06-191-1/+1
| | | '\0' is the NUL byte not NULL.
* bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async ↵Jeroen Demeyer2019-05-311-6/+6
| | | | | | | | | (GH-13464) Automatically replace tp_print -> tp_vectorcall_offset tp_compare -> tp_as_async tp_reserved -> tp_as_async
* Change WriterObj.writeline to WriterObj.write (GH-12344)Rémi Lapeyre2019-05-141-10/+12
| | | This cleans the csv module a bit, I don't think it requires a bpo issue or a news entry.
* bpo-35459: Use PyDict_GetItemWithError() instead of PyDict_GetItem(). (GH-11112)Serhiy Storchaka2019-02-251-3/+7
|
* bpo-33029: Fix signatures of getter and setter functions. (GH-10746)Serhiy Storchaka2018-11-271-5/+5
| | | Fix also return type for few other functions (clear, releasebuffer).
* bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)Serhiy Storchaka2018-11-271-3/+3
| | | | | | Fix invalid function cast warnings with gcc 8 for method conventions different from METH_NOARGS, METH_O and METH_VARARGS excluding Argument Clinic generated code.
* bpo-34395: Fix memory leaks caused by incautious usage of PyMem_Resize(). ↵Sergey Fedoseev2018-08-161-36/+15
| | | | (GH-8756)
* bpo-34197: Make _csv.Dialect attributes booleans. (GH-8440)Serhiy Storchaka2018-07-261-15/+16
| | | | Attributes skipinitialspace, doublequote and strict are now booleans instead of integers 0 or 1.
* bpo-32747: Remove trailing spaces in docstrings. (GH-5491)oldk2018-02-021-4/+4
|
* bpo-32255: Always quote a single empty field when write into a CSV file. (#4769)Licht Takeuchi2017-12-121-1/+1
| | | This allows to distinguish an empty row from a row consisting of a single empty field.
* Use NULL rather than 0. (#778)Serhiy Storchaka2017-03-231-8/+8
| | | | | There was few cases of using literal 0 instead of NULL in the context of pointers. While this was a legitimate C code, using NULL rather than 0 makes the code clearer.
* Issue #28999: Use Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE whereverSerhiy Storchaka2017-01-231-8/+4
| | | | possible. Patch is writen with Coccinelle.
* Backed out changeset b9c9691c72c5Victor Stinner2016-12-041-1/+1
| | | | | | Issue #28858: The change b9c9691c72c5 introduced a regression. It seems like _PyObject_CallArg1() uses more stack memory than PyObject_CallFunctionObjArgs().
* Replace PyObject_CallFunctionObjArgs() with fastcallVictor Stinner2016-12-011-1/+1
| | | | | | | | | | | | | | * PyObject_CallFunctionObjArgs(func, NULL) => _PyObject_CallNoArg(func) * PyObject_CallFunctionObjArgs(func, arg, NULL) => _PyObject_CallArg1(func, arg) PyObject_CallFunctionObjArgs() allocates 40 bytes on the C stack and requires extra work to "parse" C arguments to build a C array of PyObject*. _PyObject_CallNoArg() and _PyObject_CallArg1() are simpler and don't allocate memory on the C stack. This change is part of the fastcall project. The change on listsort() is related to the issue #23507.
* _csv: use _PyLong_AsInt()Victor Stinner2016-10-191-10/+4
|
* Issue #27809: _csv: _call_dialect() uses fast callVictor Stinner2016-08-221-9/+7
|
* merge 3.5 (closes #27758)Benjamin Peterson2016-08-141-4/+19
|\
| * merge 3.4 (closes #27758)Benjamin Peterson2016-08-141-4/+19
| |\