[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the patch in 3.2 and 3.3. -- resolution: -> fixed stage: needs patch -> committed/rejected status: open -> closed ___ Python tracker __

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4966907d3661 by Antoine Pitrou in branch '3.2': Issue #14177: marshal.loads() now raises TypeError when given an unicode string. http://hg.python.org/cpython/rev/4966907d3661 New changeset e67b3a9bd2dc by Antoine Pitrou in branch 'default': - Issue

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread guilherme-pg
guilherme-pg added the comment: Guilherme Gonçalves Thanks for the quick review. -- ___ Python tracker ___ ___ Python-bugs-list mai

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you! What is your full name, for credits? -- ___ Python tracker ___ ___ Python-bugs-list mail

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread guilherme-pg
guilherme-pg added the comment: Oops, sorry, that was unintended. I uploaded a new version of the patch with the correct documentation update, making it explicit that loads() expects a bytes object. -- Added file: http://bugs.python.org/file24717/14177-marshal-loads-deny-strings-2.pa

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread Antoine Pitrou
Antoine Pitrou added the comment: Thank you. The patch looks almost perfect, just one nit: apparently you changed the documentation for marshal.dumps. Is that intended? -- ___ Python tracker _

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread guilherme-pg
guilherme-pg added the comment: The attached patch attempts to solve the issue. It makes sure marshal.loads only accepts objects conforming to the buffer protocol, updates the documentation for the method accordingly, adds a test case and updates existing test cases that rely on this issue.

[issue14177] marshal.loads accepts unicode strings

2012-03-02 Thread Antoine Pitrou
New submission from Antoine Pitrou : >>> 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 "", line 1, in TypeError: f.read() returned not bytes but str -