summaryrefslogtreecommitdiffstats
path: root/Modules/tkappinit.c
diff options
context:
space:
mode:
authorTim Peters <tim.peters@gmail.com>2001-04-10 04:22:00 (GMT)
committerTim Peters <tim.peters@gmail.com>2001-04-10 04:22:00 (GMT)
commit3906eb877a7010dae5faf7ff2d48634d56ed5ec2 (patch)
treecc975bb7f641a9128f56d10fa20d0d949fe84a8e /Modules/tkappinit.c
parente089c688717fbc7c208ad30ee885dcd93a4de678 (diff)
downloadcpython-3906eb877a7010dae5faf7ff2d48634d56ed5ec2.zip
cpython-3906eb877a7010dae5faf7ff2d48634d56ed5ec2.tar.gz
cpython-3906eb877a7010dae5faf7ff2d48634d56ed5ec2.tar.bz2
On a sizeof(long)==8 machine, ints in range(2**31, 2**32) were getting
pickled into the signed(!) 4-byte BININT format, so were getting unpickled again as negative ints. Repaired that. Added some minimal docs at the top about what I've learned about the pickle format codes (little of which was obvious from staring at the code, although that's partly because all the size-related bugs greatly obscured the true intent of the code). Happy side effect: because save_int() needed to grow a *proper* range check in order to fix this bug, it can now use the more-efficient BININT1, BININT2 and BININT formats when the long's value is small enough to fit in a signed 4-byte int (before this, on a sizeof(long)==8 box it always used the general INT format for negative ints). test_cpickle works again on sizeof(long)==8 machines. test_pickle is still busted big-time.
Diffstat (limited to 'Modules/tkappinit.c')
0 files changed, 0 insertions, 0 deletions