소스 검색

[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