[New-bugs-announce] [issue4975] 3.0 base64 doc examples lack bytes 'b' indicator

Terry J. Reedy report at bugs.python.org
Sat Jan 17 22:33:00 CET 2009

New submission from Terry J. Reedy <tjreedy at udel.edu>:

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

TypeError: expected bytes, not str

assignee: georg.brandl
components: Documentation
messages: 80048
nosy: georg.brandl, tjreedy
severity: normal
status: open
title: 3.0 base64 doc examples lack bytes 'b' indicator

Python tracker <report at bugs.python.org>

More information about the New-bugs-announce mailing list