From 7acf4eec792f155a8b0e92c3bb1efa1ff5882ac8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adri=C3=A1n=20Chaves?= Date: Tue, 2 Apr 2019 18:36:03 +0200 Subject: [PATCH] Deprecate the scrapy.utils.gz.is_gzipped function --- scrapy/utils/gz.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/scrapy/utils/gz.py b/scrapy/utils/gz.py index ec3949651..b3fb16b1e 100644 --- a/scrapy/utils/gz.py +++ b/scrapy/utils/gz.py @@ -9,6 +9,9 @@ from gzip import GzipFile import six import re +from scrapy.utils.decorators import deprecated + + # - Python>=3.5 GzipFile's read() has issues returning leftover # uncompressed data when input is corrupted # (regression or bug-fix compared to Python 3.4) @@ -53,6 +56,7 @@ def gunzip(data): _is_gzipped = re.compile(br'^application/(x-)?gzip\b', re.I).search _is_octetstream = re.compile(br'^(application|binary)/octet-stream\b', re.I).search +@deprecated def is_gzipped(response): """Return True if the response is gzipped, or False otherwise""" ctype = response.headers.get('Content-Type', b'')