[issue24503] csv.writer fails when within csv.reader

2015-07-22 Thread R. David Murray
R. David Murray added the comment: No, the object is just a wrapper around an iterator. It doesn't know or care that you've passed in a file iterator...it is the file iterator's behavior that is non standard (this has been discussed elsewhere in the tracker, but it is not something that can b

[issue24503] csv.writer fails when within csv.reader

2015-07-22 Thread Wolfgang E. Sanyer
Wolfgang E. Sanyer added the comment: You can close this - it turns out that I was looping through the input file once first, and did not properly rewind it after doing so. Might it make sense to have the csv module rewind the file after it has been looped through, so that it acts as a typical

[issue24503] csv.writer fails when within csv.reader

2015-06-25 Thread Skip Montanaro
Skip Montanaro added the comment: @ezzieyguywuf - Can you provide an example of a non-empty input.csv which fails for you? Otherwise, I'd have to agree with @josh.r and @vadmium that it's working as it should. -- nosy: +skip.montanaro ___ Python tra

[issue24503] csv.writer fails when within csv.reader

2015-06-24 Thread Josh Rosenberg
Josh Rosenberg added the comment: Obvious possibility: input.csv is empty, so the loop never executes. You could always add prints within the loop as well, so you know it actually read something. -- nosy: +josh.r ___ Python tracker

[issue24503] csv.writer fails when within csv.reader

2015-06-24 Thread Martin Panter
Martin Panter added the comment: It’s working properly for me in 2.7.10: $ cat -A input.csv a,b,c$ 1,2,3$ $ python2 testcase.py $ cat -A output.csv d,a,t,a^M$ d,a,t,a^M$ m,o,r,e, ,d,a,t,a^M$ -- nosy: +vadmium stage: -> test needed ___ Python tracker

[issue24503] csv.writer fails when within csv.reader

2015-06-24 Thread Wolfgang E. Sanyer
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("in