From d740b051cbeda3ce4df1cd885d58eedcebb63443 Mon Sep 17 00:00:00 2001 From: Christophe Dumez Date: Sat, 19 Jan 2013 19:29:51 +0200 Subject: [PATCH] Really fix kat search engine with python3 --- src/searchengine/nova3/helpers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/searchengine/nova3/helpers.py b/src/searchengine/nova3/helpers.py index 98ce6ffb8..64a4e6b5a 100644 --- a/src/searchengine/nova3/helpers.py +++ b/src/searchengine/nova3/helpers.py @@ -22,7 +22,7 @@ # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE # POSSIBILITY OF SUCH DAMAGE. -#VERSION: 1.32 +#VERSION: 1.33 # Author: # Christophe DUMEZ (chris@qbittorrent.org) @@ -64,9 +64,9 @@ def retrieve_url(url): response = urllib.request.urlopen(url) dat = response.read() # Check if it is gzipped - if dat[:2] == '\037\213': + if dat[:2] == b'\x1f\x8b': # Data is gzip encoded, decode it - compressedstream = StringIO.StringIO(dat) + compressedstream = io.BytesIO(dat) gzipper = gzip.GzipFile(fileobj=compressedstream) extracted_data = gzipper.read() dat = extracted_data