From c82893cb8c6b2a4a876965426c5a5bc4590e1583 Mon Sep 17 00:00:00 2001 From: Jon Dufresne Date: Mon, 1 Oct 2018 18:18:04 -0500 Subject: 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. --- docs/ref/utils.txt | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'docs/ref') 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`` =============================== -- cgit v1.3