Skip to content

Scrapy, a fast high-level web crawling & scraping framework for Python.

Remove deprecated modules (utils.http/markup/multipart)

Eugenio Lacuesta4075e1eadd0a
diff --git a/pytest.ini b/pytest.ini
index 1c95f715a..d4deeb57c 100644
--- a/pytest.ini
+++ b/pytest.ini
@@ -36,8 +36,5 @@ flake8-ignore =
scrapy/spiders/__init__.py E402 F401
# Issues pending a review:
- scrapy/utils/http.py F403
- scrapy/utils/markup.py F403
- scrapy/utils/multipart.py F403
scrapy/utils/url.py F403 F405
tests/test_loader.py E741
diff --git a/scrapy/utils/http.py b/scrapy/utils/http.py
deleted file mode 100644
index ceb3f0509..000000000
--- a/scrapy/utils/http.py
+++ /dev/null
@@ -1,36 +0,0 @@
-"""
-Transitional module for moving to the w3lib library.
-
-For new code, always import from w3lib.http instead of this module
-"""
-
-import warnings
-
-from scrapy.exceptions import ScrapyDeprecationWarning
-from scrapy.utils.decorators import deprecated
-from w3lib.http import * # noqa: F401
-
-
-warnings.warn("Module `scrapy.utils.http` is deprecated, "
- "Please import from `w3lib.http` instead.",
- ScrapyDeprecationWarning, stacklevel=2)
-
-
-@deprecated
-def decode_chunked_transfer(chunked_body):
- """Parsed body received with chunked transfer encoding, and return the
- decoded body.
-
- For more info see:
- https://en.wikipedia.org/wiki/Chunked_transfer_encoding
-
- """
- body, h, t = '', '', chunked_body
- while t:
- h, t = t.split('\r\n', 1)
- if h == '0':
- break
- size = int(h, 16)
- body += t[:size]
- t = t[size + 2:]
- return body
diff --git a/scrapy/utils/markup.py b/scrapy/utils/markup.py
deleted file mode 100644
index 9728c542a..000000000
--- a/scrapy/utils/markup.py
+++ /dev/null
@@ -1,14 +0,0 @@
-"""
-Transitional module for moving to the w3lib library.
-
-For new code, always import from w3lib.html instead of this module
-"""
-import warnings
-
-from scrapy.exceptions import ScrapyDeprecationWarning
-from w3lib.html import * # noqa: F401
-
-
-warnings.warn("Module `scrapy.utils.markup` is deprecated. "
- "Please import from `w3lib.html` instead.",
- ScrapyDeprecationWarning, stacklevel=2)
diff --git a/scrapy/utils/multipart.py b/scrapy/utils/multipart.py
deleted file mode 100644
index 5dcf791b8..000000000
--- a/scrapy/utils/multipart.py
+++ /dev/null
@@ -1,15 +0,0 @@
-"""
-Transitional module for moving to the w3lib library.
-
-For new code, always import from w3lib.form instead of this module
-"""
-import warnings
-
-from scrapy.exceptions import ScrapyDeprecationWarning
-from w3lib.form import * # noqa: F401
-
-
-warnings.warn("Module `scrapy.utils.multipart` is deprecated. "
- "If you're using `encode_multipart` function, please use "
- "`urllib3.filepost.encode_multipart_formdata` instead",
- ScrapyDeprecationWarning, stacklevel=2)