[issue14177] marshal.loads accepts unicode strings

Antoine Pitrou report at bugs.python.org
Fri Mar 2 17:25:12 CET 2012


New submission from Antoine Pitrou <pitrou at free.fr>:

>>> marshal.loads('T')
True
>>> marshal.loads(b'T')
True

Contrast with:

>>> marshal.load(io.BytesIO(b'T'))
True
>>> marshal.load(io.StringIO('T'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
TypeError: f.read() returned not bytes but str

----------
components: Extension Modules
keywords: easy
messages: 154778
nosy: pitrou
priority: normal
severity: normal
stage: needs patch
status: open
title: marshal.loads accepts unicode strings
type: behavior
versions: Python 3.2, Python 3.3

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


More information about the Python-bugs-list mailing list