You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Briefly describe the question, bug or feature request.
As mentioned in this issue of xsv, it seems that rust-csv is flushing the underlying writer when its internal buffer becomes full. This causes issues for xsv as the underlying writer is a TabWriter and calling flush causes side-effects other than writing out the buffer (specifically, it resets the internal state, "breaking" alignment of subsequently written data)
Include a complete program demonstrating a problem.
The reproduction with xsv is attached on the linked issue - using a small rust-csv buffer size leads to broken tabular layout.
What is the expected or desired behavior of the code above?
When the internal buffer becomes full, its contents should be written to the underlying writer, but the underlying writer should not be flushed. This seems to match with other buffering IO libraries, such as BufferedWriter in Java and rust's stdlib
The text was updated successfully, but these errors were encountered:
owst
added a commit
to owst/rust-csv
that referenced
this issue
Oct 6, 2019
This fixes a bug where the CSV writer was erroneously flushing the
underlying writer when its internal buffer was full. Instead, when the
internal buffer is full, it should simply write the contents of the buffer
to the underlying writer. There is no need to flush it. Indeed, this causes
other problems such as those observed in
BurntSushi/xsv#151.
We are careful to ensure that calling `flush` explicitly still calls `flush`
on the underlying writer.
Fixes#173
What version of the
csv
crate are you using?master:
fcdbea357739348b9eed2a0239e180213be78af9
Briefly describe the question, bug or feature request.
As mentioned in this issue of
xsv
, it seems that rust-csv is flushing the underlying writer when its internal buffer becomes full. This causes issues forxsv
as the underlying writer is aTabWriter
and callingflush
causes side-effects other than writing out the buffer (specifically, it resets the internal state, "breaking" alignment of subsequently written data)Include a complete program demonstrating a problem.
The reproduction with
xsv
is attached on the linked issue - using a smallrust-csv
buffer size leads to broken tabular layout.What is the expected or desired behavior of the code above?
When the internal buffer becomes full, its contents should be written to the underlying writer, but the underlying writer should not be
flush
ed. This seems to match with other buffering IO libraries, such asBufferedWriter
in Java and rust's stdlibThe text was updated successfully, but these errors were encountered: