summaryrefslogtreecommitdiffstats
path: root/Lib/csv.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/csv.py')
-rw-r--r--Lib/csv.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/csv.py b/Lib/csv.py
index 32a377e..53ed90c 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -72,6 +72,8 @@ class DictReader:
self.restkey = restkey # key to catch long rows
self.restval = restval # default value for short rows
self.reader = reader(f, dialect, *args, **kwds)
+ self.dialect = dialect
+ self.line_num = 0
def __iter__(self):
return self
@@ -81,6 +83,7 @@ class DictReader:
if self.fieldnames is None:
self.fieldnames = row
row = next(self.reader)
+ self.line_num = self.reader.line_num
# unlike the basic reader, we prefer not to return blanks,
# because we will typically wind up with a dict full of None