Skip to content

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

deprecate scrapy.utils.multipart

Mikhail Korobov64ff3cd6aac9
diff --git a/scrapy/utils/multipart.py b/scrapy/utils/multipart.py
index ec26c0866..c2d8afd07 100644
--- a/scrapy/utils/multipart.py
+++ b/scrapy/utils/multipart.py
@@ -3,5 +3,13 @@ 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 *
+
+
+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)
\ No newline at end of file