This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: 3.0 base64 doc examples lack bytes 'b' indicator
Type: Stage:
Components: Documentation Versions:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: georg.brandl Nosy List: georg.brandl, terry.reedy
Priority: normal Keywords:

Created on 2009-01-17 21:33 by terry.reedy, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Messages (2)
msg80048 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2009-01-17 21:32
This unconverted example in the 3.1a doc needs a 'b' for 'bytes' added
before the three input and output string literals.

>>> import base64
>>> encoded = base64.b64encode('data to be encoded') # here
>>> encoded
'ZGF0YSB0byBiZSBlbmNvZGVk' # here
>>> data = base64.b64decode(encoded)
>>> data
'data to be encoded' #and here

Otherwise,
TypeError: expected bytes, not str
msg80087 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2009-01-18 10:44
Thanks, fixed in r68719.
History
Date User Action Args
2022-04-11 14:56:44adminsetgithub: 49225
2009-01-18 10:44:06georg.brandlsetstatus: open -> closed
resolution: fixed
messages: + msg80087
2009-01-17 21:33:00terry.reedycreate