Author belopolsky
Recipients alexandre.vassalotti, amaury.forgeotdarc, belopolsky, nyevik, pitrou
Date 2011-03-16.14:18:15
SpamBayes Score 9.98875e-10
Marked as misclassified No
Message-id <AANLkTi=MTj2czgLmGyRMvF46s_kxCD29vMNbFQ=5yjjJ@mail.gmail.com>
In-reply-to <1300230353.38.0.0540268603526.issue11564@psf.upfronthosting.co.za>
Content
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.
History
Date User Action Args
2011-03-16 14:18:15belopolskysetrecipients: + belopolsky, amaury.forgeotdarc, pitrou, alexandre.vassalotti, nyevik
2011-03-16 14:18:15belopolskylinkissue11564 messages
2011-03-16 14:18:15belopolskycreate