Message131118
On Tue, Mar 15, 2011 at 7:05 PM, Antoine Pitrou <report@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. |
|
Date |
User |
Action |
Args |
2011-03-16 14:18:15 | belopolsky | set | recipients:
+ belopolsky, amaury.forgeotdarc, pitrou, alexandre.vassalotti, nyevik |
2011-03-16 14:18:15 | belopolsky | link | issue11564 messages |
2011-03-16 14:18:15 | belopolsky | create | |
|