From e044bfa60f072aca25e5561136dc0b9e89b2a1ed Mon Sep 17 00:00:00 2001 From: nyov Date: Sat, 25 Jul 2015 20:51:27 +0000 Subject: [PATCH] PY3 fix test downloadermiddleware decompression --- scrapy/responsetypes.py | 4 ++-- tests/py3-ignores.txt | 1 - tests/test_downloadermiddleware_decompression.py | 2 +- tests/test_responsetypes.py | 2 +- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/scrapy/responsetypes.py b/scrapy/responsetypes.py index 7c017feef..c212f5706 100644 --- a/scrapy/responsetypes.py +++ b/scrapy/responsetypes.py @@ -92,9 +92,9 @@ class ResponseTypes(object): chunk = body[:5000] if isbinarytext(chunk): return self.from_mimetype('application/octet-stream') - elif "" in chunk.lower(): + elif b"" in chunk.lower(): return self.from_mimetype('text/html') - elif " %s != %s" % (source, retcls, cls) - + def test_from_headers(self): mappings = [ ({'Content-Type': ['text/html; charset=utf-8']}, HtmlResponse),