csv.Error
Prev: csv.DictWriter | Up: csv | Next: csv.excel
Rel: csv.Dialect, csv.DictReader, csv.DictWriter, csv.excel
Ref: docs.python.org โ csv.Error
Tags: #public #python3 #stdlib #csv
Import
import csv
from csv import Error
Signature & Overview
csv.Error(...)
csv.Error class.
Methods & Attributes
Error.add_note(self, note, /)โ Add a note to the exceptionError.with_traceback(self, tb, /)โ Set self.traceback to tb and return self.
Usage
import csv
try:
list(csv.reader(["a,b\x00c"]))
except csv.Error as exc:
assert "NUL" in str(exc) or "line" in str(exc)
Gotchas
- Raised on malformed CSV syntax or NUL bytes: Also raised when a single field exceeds
csv.field_size_limit().
REPL Inspect
from csv import Error
help(Error)
Linked from
- tuts/python3/stdlib_module/csv
- tuts/python3/stdlib_module/csv/Dialect
- tuts/python3/stdlib_module/csv/DictReader
- tuts/python3/stdlib_module/csv/DictWriter
- tuts/python3/stdlib_module/csv/excel
- tuts/python3/stdlib_module/csv/excel_tab
- tuts/python3/stdlib_module/csv/field_size_limit
- tuts/python3/stdlib_module/csv/get_dialect
- tuts/python3/stdlib_module/csv/list_dialects
- tuts/python3/stdlib_module/csv/reader
- tuts/python3/stdlib_module/csv/register_dialect
- tuts/python3/stdlib_module/csv/Sniffer
- tuts/python3/stdlib_module/csv/unix_dialect
- tuts/python3/stdlib_module/csv/unregister_dialect
- tuts/python3/stdlib_module/csv/writer
Related notes
- tuts/python3/stdlib_module/csv/Dialect Linked here; links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/DictReader Linked here; links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/DictWriter Linked here; links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/excel Linked here; links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv Linked here; links to this page; shared tags: #stdlib
- tuts/python3/stdlib_module/csv/excel_tab links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/field_size_limit links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/get_dialect links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/list_dialects links to this page; shared tags: #csv, #stdlib
- tuts/python3/stdlib_module/csv/reader links to this page; shared tags: #csv, #stdlib