1
0
mirror of https://github.com/searxng/searxng.git synced 2024-11-22 20:17:45 +01:00

[fix] remove trailing 0x00 from csv output

This commit is contained in:
Adam Tauber 2017-11-21 16:58:51 +01:00
parent 3d6c67951a
commit b5071fea6a

View File

@ -169,6 +169,8 @@ class UnicodeWriter:
data = self.queue.getvalue()
if IS_PY2:
data = data.decode("utf-8")
else:
data = data.strip('\x00')
# ... and reencode it into the target encoding
data = self.encoder.encode(data)
# write to the target stream