浏览代码

[fix] remove trailing 0x00 from csv output

Adam Tauber 7 年前
父节点
当前提交
b5071fea6a
共有 1 个文件被更改,包括 2 次插入0 次删除
  1. 2
    0
      searx/utils.py

+ 2
- 0
searx/utils.py 查看文件

169
         data = self.queue.getvalue()
169
         data = self.queue.getvalue()
170
         if IS_PY2:
170
         if IS_PY2:
171
             data = data.decode("utf-8")
171
             data = data.decode("utf-8")
172
+        else:
173
+            data = data.strip('\x00')
172
         # ... and reencode it into the target encoding
174
         # ... and reencode it into the target encoding
173
         data = self.encoder.encode(data)
175
         data = self.encoder.encode(data)
174
         # write to the target stream
176
         # write to the target stream