summaryrefslogtreecommitdiff
path: root/django/utils
diff options
context:
space:
mode:
authorMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-05 12:18:04 +0100
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-01-14 17:50:04 +0100
commit88ed1c8d08c70fd3e7943fc8383459545f726dcd (patch)
treecd103e59a30123d8cacde708ea35566534927f58 /django/utils
parentb7dd89ed5389067cb70294682ffef1ba23d33934 (diff)
Refs #27753 -- Removed django.utils.http urllib aliases per deprecation timeline.
Diffstat (limited to 'django/utils')
-rw-r--r--django/utils/http.py62
1 files changed, 2 insertions, 60 deletions
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