[issue27497] csv module: Add return value to DictWriter.writeheader

STINNER Victor report at bugs.python.org
Thu May 9 21:52:50 EDT 2019


STINNER Victor <vstinner at redhat.com> added the comment:

I merged PR 12306. Thanks Ashish Nitin Patil for the initial patch, thanks Rémi Lapeyre to converting it to a PR, thanks Logan for the initial bug report ;-)

Sadly, this change is a new feature and so cannot be backported to 2.7 or 3.7. The workaround is override the method:

    def writeheader(self):
        header = dict(zip(self.fieldnames, self.fieldnames))
        return self.writerow(header)

----------
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue27497>
_______________________________________


More information about the Python-bugs-list mailing list