[issue17710] SystemError in cPickle for incorrect input

2013-04-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: I've committed the patches. Feel free to improve the default branch if you like. -- resolution: -> fixed stage: patch review -> committed/rejected status: open -> closed ___ Python tracker

[issue17710] SystemError in cPickle for incorrect input

2013-04-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4e412cbaaf96 by Antoine Pitrou in branch '3.3': Issue #17710: Fix pickle raising a SystemError on bogus input. http://hg.python.org/cpython/rev/4e412cbaaf96 New changeset 5a16d2992112 by Antoine Pitrou in branch 'default': Issue #17710: Fix pickle r

[issue17710] SystemError in cPickle for incorrect input

2013-04-15 Thread Roundup Robot
Roundup Robot added the comment: New changeset 527b7f88b53c by Antoine Pitrou in branch '2.7': Issue #17710: Fix cPickle raising a SystemError on bogus input. http://hg.python.org/cpython/rev/527b7f88b53c -- nosy: +python-dev ___ Python tracker

[issue17710] SystemError in cPickle for incorrect input

2013-04-15 Thread Antoine Pitrou
Antoine Pitrou added the comment: > I was targeting head, not the release branches. Perhaps, but I don't see the point of choosing a different fix in the default branch than in the bugfix branches. -- ___ Python tracker

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Alexandre Vassalotti
Changes by Alexandre Vassalotti : Removed file: http://bugs.python.org/file29824/fix_quoted_string_python3.patch ___ Python tracker ___ ___ Py

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I was targeting head, not the release branches. It is fine to change the exception there as we don't make any guarantee about the exceptions raised during the unpickling process. It is easy enough to fix patch use ValueError for the release branch. And

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Alexandre, I don't like your patch very much: - you are changing the exception from ValueError to UnpicklingError (which doesn't derive from ValueError) in a bugfix release - you aren't actually adding any guards in the C code, so it's not demonstrably more rob

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Alexandre Vassalotti
Alexandre Vassalotti added the comment: I also wrote a patch for this. I took I slightly different approach though. I fixed the C implementation to be more strict on the quoting. Currently, it strips trailing non-printable characters, something pickle.py doesn't do. I also cleaned up the tests

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Of course, UnpicklingError is not a bug. Perhaps almost any exception except SystemError is not a bug. I mention it because it's a case where Python 3 differs from Python 2. I think _pickle.c patches can be simplified. +if (len < 2) +goto insecu

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: And here is a 3.x patch. -- Added file: http://bugs.python.org/file29816/pickle_systemerror.patch ___ Python tracker ___ ___

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Hmm, forget what I just said. A SystemError can actually be triggered through a slightly longer line: $ ./python -c "import pickle; print (repr(pickle.loads(b\"S'\np0\n.\")))" Traceback (most recent call last): File "", line 1, in SystemError: Negative s

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: I don't think the UnpicklingError in 3.x is a bug, though: it's just a different exception than ValueError. It's just a shame that the two are used interchangeably for the same purpose. -- stage: needs patch -> patch review versions: -Python 3.3, Pyth

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Antoine Pitrou
Changes by Antoine Pitrou : -- versions: +Python 3.3, Python 3.4 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Antoine Pitrou
Antoine Pitrou added the comment: Here is a patch for 2.7. -- keywords: +patch Added file: http://bugs.python.org/file29813/cpickle_systemerror.patch ___ Python tracker ___ _

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread STINNER Victor
Changes by STINNER Victor : -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.

[issue17710] SystemError in cPickle for incorrect input

2013-04-13 Thread Serhiy Storchaka
New submission from Serhiy Storchaka: >>> import cPickle >>> cPickle.loads(b"S' \np0\n.") Traceback (most recent call last): File "", line 1, in SystemError: Negative size passed to PyString_FromStringAndSize >>> pickle.loads(b"S' \np0\n.") Traceback (most recent call last): File "", line 1,