[issue10807] `b'dGVzdA==\n'.decode('base64')` raise exception

yihuang report at bugs.python.org
Sun Jan 2 19:22:49 CET 2011


New submission from yihuang <yi.codeplayer at gmail.com>:

>>> b'dGVzdA==\n'.decode('base64')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "../Lib/encodings/base64_codec.py", line 20, in base64_decode
    return (base64.decodebytes(input), len(input))
  File "../Lib/base64.py", line 359, in decodebytes
    raise TypeError("expected bytes, not %s" % s.__class__.__name__)
TypeError: expected bytes, not memoryview

----------
components: Unicode
messages: 125068
nosy: yi.codeplayer
priority: normal
severity: normal
status: open
title: `b'dGVzdA==\n'.decode('base64')` raise exception
type: behavior
versions: Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue10807>
_______________________________________


More information about the Python-bugs-list mailing list