Commit 1af5baf2 authored by Arnaud Fontaine's avatar Arnaud Fontaine

py3: base64.{decode,encode}string() renamed to {decode,encode}bytes().

{encode,decode}string() aliases available but clearer this way...
parent 088c4663
...@@ -28,7 +28,7 @@ from future import standard_library ...@@ -28,7 +28,7 @@ from future import standard_library
standard_library.install_aliases() standard_library.install_aliases()
from builtins import str from builtins import str
from past.builtins import basestring from past.builtins import basestring
from base64 import encodestring, decodestring from base64 import encodebytes, decodebytes
from hashlib import md5 from hashlib import md5
from re import compile from re import compile
from time import gmtime, strftime, time from time import gmtime, strftime, time
...@@ -97,7 +97,7 @@ def message_encode(message): ...@@ -97,7 +97,7 @@ def message_encode(message):
encoding = HTTPRequest.default_encoding encoding = HTTPRequest.default_encoding
message = message.encode(encoding) message = message.encode(encoding)
return encodestring(message) return encodebytes(message)
def message_decode(message): def message_decode(message):
...@@ -106,7 +106,7 @@ def message_decode(message): ...@@ -106,7 +106,7 @@ def message_decode(message):
To be used in the user interface, to avoid problems with the To be used in the user interface, to avoid problems with the
encodings, HTML entities, etc.. encodings, HTML entities, etc..
""" """
message = decodestring(message) message = decodebytes(message)
encoding = HTTPRequest.default_encoding encoding = HTTPRequest.default_encoding
return str(message, encoding) return str(message, encoding)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment