From 677bfa03ea26a012a51ca22f1f5c1cbb1a1cdd07 Mon Sep 17 00:00:00 2001 From: Simon Date: Mon, 18 Jun 2018 20:30:18 -0400 Subject: [PATCH] Another fix for encoding problems --- crawl_server/remote_http.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crawl_server/remote_http.py b/crawl_server/remote_http.py index 74e8003..e8420a4 100644 --- a/crawl_server/remote_http.py +++ b/crawl_server/remote_http.py @@ -151,7 +151,7 @@ class HttpDirectory(RemoteDirectory): try: r = self.session.get(url, stream=True, timeout=40) for chunk in r.iter_content(chunk_size=4096): - yield chunk.decode(r.encoding, errors="ignore") + yield chunk.decode(r.encoding if r.encoding else "utf-8", errors="ignore") r.close() del r break