[New-bugs-announce] [issue24503] csv.writer fails when within csv.reader

Wolfgang E. Sanyer report at bugs.python.org
Wed Jun 24 22:05:15 CEST 2015


New submission from Wolfgang E. Sanyer:

I have a use case where I am using a csv.reader to loop through one file and trying to use a csv.writer to output to another file. However, when I do this, the csv.writer instance does not write anything to the output file.

ex:

import csv

with open("input.csv", "rb") as input, open("output.csv", "wb") as output:
    reader = csv.reader(input)
    writer = csv.writer(output)

    for row in reader:
        writer.writerow("data") # this writes out nothing
    
    writer.writerow("more data") # this writes out something

----------
components: Library (Lib)
messages: 245772
nosy: ezzieyguywuf
priority: normal
severity: normal
status: open
title: csv.writer fails when within csv.reader
type: behavior
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue24503>
_______________________________________


More information about the New-bugs-announce mailing list