[New-bugs-announce] [issue4205] unexpected str.__init__() behaviour on b''

Eric Devolder report at bugs.python.org
Sat Oct 25 23:44:55 CEST 2008


New submission from Eric Devolder <eric.devolder at gmail.com>:

creating a unicode string from an empty b'' does not result in '', but
produces "b''" instead.

>>> str(b'')
"b''"

Workaround: if the encoding is specified, the resulting string is fine.
>>> str(b'', 'ascii')
''

----------
components: Interpreter Core, Unicode
messages: 75220
nosy: keldonin
severity: normal
status: open
title: unexpected str.__init__() behaviour on b''
type: behavior
versions: Python 3.0

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


More information about the New-bugs-announce mailing list