New submission from STINNER Victor <vstin...@python.org>:

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().

----------
components: Library (Lib)
messages: 360096
nosy: vstinner
priority: normal
severity: normal
status: open
title: Remove base64.encodestring() and base64.decodestring() aliases, 
deprecated since Python 3.1
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue39351>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to