Skip to content

SearXNG is a free internet metasearch engine which aggregates results from various search services and databases. Users are neither tracked nor profiled.

[fix] remove trailing 0x00 from csv output

Adam Tauberb5071fea6a4a
diff --git a/searx/utils.py b/searx/utils.py
index 2fa6ebf0c..9494bdf3d 100644
--- a/searx/utils.py
+++ b/searx/utils.py
@@ -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