From fb3f65cdcc8a29ebfd9815efb7009a3c2dd4041c Mon Sep 17 00:00:00 2001 From: Nick Muerdter <12112+GUI@users.noreply.github.com> Date: Fri, 31 May 2019 18:52:57 -0600 Subject: [PATCH] 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. --- linkcheck/logger/csvlog.py | 1 + 1 file changed, 1 insertion(+) diff --git a/linkcheck/logger/csvlog.py b/linkcheck/logger/csvlog.py index 21ec9528..d91a13d4 100644 --- a/linkcheck/logger/csvlog.py +++ b/linkcheck/logger/csvlog.py @@ -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):