Fix CSV output containing increasing number of null byte characters.

The CSV buffer is being truncated on each new row, but since the
stream's pointer isn't also being reset, each new row starts at the same
position as the previous row, but with null bytes up until that point.
This leads to increasing growth in the length of each CSV row, since
each line will be padded with null bytes equivalent to the previous
row's length.
This commit is contained in:
Nick Muerdter 2019-05-31 18:52:57 -06:00
parent 1c2e6c465e
commit fb3f65cdcc
No known key found for this signature in database
GPG key ID: 7C517C5A1A14988A

View file

@ -128,6 +128,7 @@ class CSVLogger (_Logger):
# ... and write to the target stream
self.write(data)
# empty queue
self.queue.seek(0)
self.queue.truncate(0)
def end_output (self, **kwargs):