Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion Lib/csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ class Dialect:

This must be subclassed (see csv.excel). Valid attributes are:
delimiter, quotechar, escapechar, doublequote, skipinitialspace,
lineterminator, quoting.
lineterminator, quoting, strict.

"""
_name = ""
Expand All @@ -105,6 +105,7 @@ class Dialect:
skipinitialspace = None
lineterminator = None
quoting = None
strict = None

def __init__(self):
if self.__class__ != Dialect:
Expand Down
2 changes: 1 addition & 1 deletion Lib/test/test_csv.py
Original file line number Diff line number Diff line change
Expand Up @@ -754,7 +754,7 @@ class mydialect(csv.Dialect):
self.assertEqual(dialect.delimiter, ';')
self.assertEqual(dialect.quoting, csv.QUOTE_ALL)
self.assertEqual(list(csv.reader(['a:b'], new)), [['a', 'b']])
# "strict" is supported even if it is not set on the class.
# "strict" is supported even if it is not set on the subclass.
self.assertTrue(copy.replace(dialect, strict=True).strict)

with self.assertRaises(csv.Error):
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Add the :attr:`~csv.Dialect.strict` attribute to :class:`csv.Dialect`.
Loading