[issue3436] csv.DictReader inconsistency

Skip Montanaro report at bugs.python.org
Sun Jul 27 05:23:45 CEST 2008

Skip Montanaro <skip at pobox.com> added the comment:

I should also point out that I've generally used this technique to 
populate the fieldnames attribute from the file:

    f = open("somefile.csv", "rb")
    rdr = csv.DictReader(f, fieldnames=csv.reader(f).next())

So it is fairly trivial to set the fieldnames attribute before actually
reading any data rows.

Python tracker <report at bugs.python.org>

More information about the Python-bugs-list mailing list