[Python-Dev] Re: [Python-checkins] CVS: python/dist/src/Lib xmlrpclib.py,1.11,1.12
Tim Peters
tim.one@home.com
Wed, 10 Oct 2001 22:56:49 -0400
[Skip]
> So instead of simply int()ing longs to marshal them, we should do
> something like
>
> val = int(val)
> if val > 2L**31-1 or val < -2L**31:
> raise OverflowError
>
> ? (Same test needed for ints...)
I don't know -- I'm not an xmlrpc guy. My guess, though, is that we should
refuse to produce anything that doesn't meet the letter of the spec
(although "the spec" in this case leaves oodles of stuff un-spec-ified, it
seemed clear about the limitation to 4 bytes for ints; OTOH, IIRC it didn't
specify 2's-complement ints, and if not we can only guess at the intended
limits).