diff options
author | andrei kulakov <andrei.avk@gmail.com> | 2022-12-09 16:14:33 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-12-09 16:14:33 (GMT) |
commit | d0679c12398579fe9f10e78b6332dded119e4697 (patch) | |
tree | 840c814be55fe6579fe099c27bf7b8c2614f85ed /Lib/csv.py | |
parent | a29a7b9b786d6b928c4bb4e6e683a3788e3ab1c1 (diff) | |
download | cpython-d0679c12398579fe9f10e78b6332dded119e4697.zip cpython-d0679c12398579fe9f10e78b6332dded119e4697.tar.gz cpython-d0679c12398579fe9f10e78b6332dded119e4697.tar.bz2 |
bpo-44512: Fix handling of extrasactions arg to csv.DictWriter with mixed or upper case (#26924)
Diffstat (limited to 'Lib/csv.py')
-rw-r--r-- | Lib/csv.py | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -139,7 +139,8 @@ class DictWriter: fieldnames = list(fieldnames) self.fieldnames = fieldnames # list of keys for the dict self.restval = restval # for writing short dicts - if extrasaction.lower() not in ("raise", "ignore"): + extrasaction = extrasaction.lower() + if extrasaction not in ("raise", "ignore"): raise ValueError("extrasaction (%s) must be 'raise' or 'ignore'" % extrasaction) self.extrasaction = extrasaction |