From 88ed1c8d08c70fd3e7943fc8383459545f726dcd Mon Sep 17 00:00:00 2001 From: Mariusz Felisiak Date: Tue, 5 Jan 2021 12:18:04 +0100 Subject: Refs #27753 -- Removed django.utils.http urllib aliases per deprecation timeline. --- django/utils/http.py | 62 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 60 deletions(-) (limited to 'django/utils') diff --git a/django/utils/http.py b/django/utils/http.py index 810d7970ba..62c30d3394 100644 --- a/django/utils/http.py +++ b/django/utils/http.py @@ -7,14 +7,12 @@ import warnings from binascii import Error as BinasciiError from email.utils import formatdate from urllib.parse import ( - ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams, quote, - quote_plus, scheme_chars, unquote, unquote_plus, - urlencode as original_urlencode, uses_params, + ParseResult, SplitResult, _coerce_args, _splitnetloc, _splitparams, + scheme_chars, unquote, urlencode as original_urlencode, uses_params, ) from django.utils.datastructures import MultiValueDict from django.utils.deprecation import RemovedInDjango40Warning -from django.utils.functional import keep_lazy_text from django.utils.regex_helper import _lazy_re_compile # based on RFC 7232, Appendix C @@ -42,62 +40,6 @@ RFC3986_GENDELIMS = ":/?#[]@" RFC3986_SUBDELIMS = "!$&'()*+,;=" -@keep_lazy_text -def urlquote(url, safe='/'): - """ - A legacy compatibility wrapper to Python's urllib.parse.quote() function. - (was used for unicode handling on Python 2) - """ - warnings.warn( - 'django.utils.http.urlquote() is deprecated in favor of ' - 'urllib.parse.quote().', - RemovedInDjango40Warning, stacklevel=2, - ) - return quote(url, safe) - - -@keep_lazy_text -def urlquote_plus(url, safe=''): - """ - A legacy compatibility wrapper to Python's urllib.parse.quote_plus() - function. (was used for unicode handling on Python 2) - """ - warnings.warn( - 'django.utils.http.urlquote_plus() is deprecated in favor of ' - 'urllib.parse.quote_plus(),', - RemovedInDjango40Warning, stacklevel=2, - ) - return quote_plus(url, safe) - - -@keep_lazy_text -def urlunquote(quoted_url): - """ - A legacy compatibility wrapper to Python's urllib.parse.unquote() function. - (was used for unicode handling on Python 2) - """ - warnings.warn( - 'django.utils.http.urlunquote() is deprecated in favor of ' - 'urllib.parse.unquote().', - RemovedInDjango40Warning, stacklevel=2, - ) - return unquote(quoted_url) - - -@keep_lazy_text -def urlunquote_plus(quoted_url): - """ - A legacy compatibility wrapper to Python's urllib.parse.unquote_plus() - function. (was used for unicode handling on Python 2) - """ - warnings.warn( - 'django.utils.http.urlunquote_plus() is deprecated in favor of ' - 'urllib.parse.unquote_plus().', - RemovedInDjango40Warning, stacklevel=2, - ) - return unquote_plus(quoted_url) - - def urlencode(query, doseq=False): """ A version of Python's urllib.parse.urlencode() function that can operate on -- cgit v1.3