aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSkip Montanaro <skip@pobox.com>2003-09-06 19:52:12 +0000
committerSkip Montanaro <skip@pobox.com>2003-09-06 19:52:12 +0000
commit3f7a94824e502d4a66acb930fbfeb559392dd3d1 (patch)
treee09e10c449453d0e625ce60d607685e9e3b1acff /Lib/csv.py
parent- reorganize sections (diff)
downloadcpython-3f7a94824e502d4a66acb930fbfeb559392dd3d1.tar.gz
cpython-3f7a94824e502d4a66acb930fbfeb559392dd3d1.tar.bz2
cpython-3f7a94824e502d4a66acb930fbfeb559392dd3d1.zip
**kwds arg was missing from __init__ for Dict{Reader,Writer} classes.
will backport.
Diffstat (limited to 'Lib/csv.py')
-rw-r--r--Lib/csv.py8
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/csv.py b/Lib/csv.py
index fcb8a8fedce..096badc7bbc 100644
--- a/Lib/csv.py
+++ b/Lib/csv.py
@@ -93,11 +93,11 @@ register_dialect("excel-tab", excel_tab)
class DictReader:
def __init__(self, f, fieldnames, restkey=None, restval=None,
- dialect="excel", *args):
+ dialect="excel", *args, **kwds):
self.fieldnames = fieldnames # list of keys for the dict
self.restkey = restkey # key to catch long rows
self.restval = restval # default value for short rows
- self.reader = reader(f, dialect, *args)
+ self.reader = reader(f, dialect, *args, **kwds)
def __iter__(self):
return self
@@ -122,7 +122,7 @@ class DictReader:
class DictWriter:
def __init__(self, f, fieldnames, restval="", extrasaction="raise",
- dialect="excel", *args):
+ dialect="excel", *args, **kwds):
self.fieldnames = fieldnames # list of keys for the dict
self.restval = restval # for writing short dicts
if extrasaction.lower() not in ("raise", "ignore"):
@@ -130,7 +130,7 @@ class DictWriter:
("extrasaction (%s) must be 'raise' or 'ignore'" %
extrasaction)
self.extrasaction = extrasaction
- self.writer = writer(f, dialect, *args)
+ self.writer = writer(f, dialect, *args, **kwds)
def _dict_to_list(self, rowdict):
if self.extrasaction == "raise":