Alexander Belopolsky <belopol...@users.sourceforge.net> added the comment:
On Tue, Mar 15, 2011 at 7:05 PM, Antoine Pitrou <rep...@bugs.python.org> wrote: .. > - (bugfix) raise a proper exception when an object too large for handling by > pickle is given What would be the "proper exception" here? With _pickle acceleration disabled, I get a struct.error: $ cat p.py import sys sys.modules['_pickle'] = None import pickle s = b'a' * (2**31) d = pickle.dumps(s) $ ./python.exe p.py Traceback (most recent call last): .. File "Lib/pickle.py", line 496, in save_bytes self.write(BINBYTES + pack("<i", n) + bytes(obj)) struct.error: 'i' format requires -2147483648 <= number <= 2147483647 I would say "proper exception" would be ValueError, but that means that we should change python implementation in an incompatible way. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue11564> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com