Explorar el Código

[fix] remove trailing 0x00 from csv output

Adam Tauber hace 7 años
padre
commit
b5071fea6a
Se han modificado 1 ficheros con 2 adiciones y 0 borrados
  1. 2
    0
      searx/utils.py

+ 2
- 0
searx/utils.py Ver fichero

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