diff options
| author | Jon Dufresne <jon.dufresne@gmail.com> | 2018-10-01 18:18:04 -0500 |
|---|---|---|
| committer | Tim Graham <timograham@gmail.com> | 2018-10-10 14:38:22 -0400 |
| commit | c82893cb8c6b2a4a876965426c5a5bc4590e1583 (patch) | |
| tree | 933e6e97f1dc87bdb2996556e83eeead7537c547 /docs | |
| parent | f3d3338e06d571a529bb2046428eeac8e56bcbf6 (diff) | |
Refs #27795 -- Removed force_bytes() usage from django/utils/http.py.
django.utils.http.urlsafe_base64_encode() now returns a string, not a
bytestring. Since URLs are represented as strings,
urlsafe_base64_encode() should return a string. All uses immediately
decoded the bytestring to a string anyway.
As the inverse operation, urlsafe_base64_decode() accepts a string.
Diffstat (limited to 'docs')
| -rw-r--r-- | docs/ref/utils.txt | 12 | ||||
| -rw-r--r-- | docs/releases/2.2.txt | 4 |
2 files changed, 14 insertions, 2 deletions
diff --git a/docs/ref/utils.txt b/docs/ref/utils.txt index f196a9b846..6f529d14fb 100644 --- a/docs/ref/utils.txt +++ b/docs/ref/utils.txt @@ -726,14 +726,22 @@ escaping HTML. .. function:: urlsafe_base64_encode(s) - Encodes a bytestring in base64 for use in URLs, stripping any trailing - equal signs. + Encodes a bytestring to a base64 string for use in URLs, stripping any + trailing equal signs. + + .. versionchanged:: 2.2 + + In older versions, it returns a bytestring instead of a string. .. function:: urlsafe_base64_decode(s) Decodes a base64 encoded string, adding back any trailing equal signs that might have been stripped. + .. versionchanged:: 2.2 + + In older versions, ``s`` may be a bytestring. + ``django.utils.module_loading`` =============================== diff --git a/docs/releases/2.2.txt b/docs/releases/2.2.txt index 7d85d30c4a..19c98639d8 100644 --- a/docs/releases/2.2.txt +++ b/docs/releases/2.2.txt @@ -298,6 +298,10 @@ Miscellaneous * Support for bytestring paths in the template filesystem loader is removed. +* :func:`django.utils.http.urlsafe_base64_encode` now returns a string instead + of a bytestring, and :func:`django.utils.http.urlsafe_base64_decode` may no + longer be passed a bytestring. + .. _deprecated-features-2.2: Features deprecated in 2.2 |
