Author vstinner
Recipients vstinner
Date 2020-01-16.08:25:17
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
base64.encodestring() and base64.decodestring() are aliases deprecated since Python 3.1: encodebytes() and decodebytes() should be used instead.

In Python 3, "string" means Unicode, whereas these functions really work at the bytes level:

>>> base64.encodestring("text")
TypeError: expected bytes-like object, not str

>>> base64.decodestring("text")
TypeError: expected bytes-like object, not str

encodebytes() and decodebytes() names are explicit on the expected types (bytes or bytes-like).

This issue is similar to bpo-38916: "Remove array.fromstring() and array.tostring() aliases, deprecated since Python 3.2".

Attached PR removes the deprecated aliases base64.encodestring() and base64.decodestring().
Date User Action Args
2020-01-16 08:25:17vstinnersetrecipients: + vstinner
2020-01-16 08:25:17vstinnersetmessageid: <>
2020-01-16 08:25:17vstinnerlinkissue39351 messages
2020-01-16 08:25:17vstinnercreate