1. 10 Apr, 2001 8 commits
    • Tim Peters's avatar
      test_pickle works on sizeof(long)==8 boxes again. · 232725f1
      Tim Peters authored
      pickle.py
          The code implicitly assumed that all ints fit in 4 bytes, causing all
          sorts of mischief (from nonsense results to corrupted pickles).
          Repaired that.
      marshal.c
          The int marshaling code assumed that right shifts of signed longs
          sign-extend.  Repaired that.
      232725f1
    • Tim Peters's avatar
      Ack -- this module mixes tabs and spaces, and what appears to be a mix · a4fe14dd
      Tim Peters authored
      of 2-space and 4-space indents.  Whatever, when I saw the checkin diff it
      was clear that what my editor thinks a tab means didn't match this module's
      belief.  Removed all the tabs from the lines I added and changed, left
      everything else alone.
      a4fe14dd
    • Tim Peters's avatar
      On a sizeof(long)==8 machine, ints in range(2**31, 2**32) were getting · ad96e09e
      Tim Peters authored
      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.
      ad96e09e
    • Tim Peters's avatar
      Test full range of native ints. This exposes two more binary pickle · e3a40af0
      Tim Peters authored
      bugs on sizeof(long)==8 machines.  pickle.py has no idea what it's
      doing with very large ints, and variously gets things right by accident,
      computes nonsense, or generates corrupt pickles.  cPickle fails on
      cases 2**31 <= i < 2**32:  since it *thinks* those are 4-byte ints
      (the "high 4 bytes" are all zeroes), it stores them in the (signed!) BININT
      format, so they get unpickled as negative values.
      e3a40af0
    • Guido van Rossum's avatar
      d3a1a155
    • Guido van Rossum's avatar
      Append the revision number for each file to the output. · 58ada0d0
      Guido van Rossum authored
      (Yes, this is a new feature right before the 2.1 release.  No, I can't
      imagine this would seriously break anybody's code.  In fact, most
      users of this script are probably *happy* to see this addition.)
      58ada0d0
    • Tim Peters's avatar
      Mechanical fiddling for easier reading: every "if" test was enclosed in · dae173fd
      Tim Peters authored
      parens, but no "while" test.  Removed the former.
      dae173fd
    • Tim Peters's avatar
      Critical fix: if cPickle on a sizeof(long)==8 box is used to read a · e93cc859
      Tim Peters authored
      binary pickle, and the latter contains a pickle of a negative Python
      int i written on a sizeof(long)==4 box (and whether by cPickle or
      pickle.py), it's read incorrectly as i + 2**32.  The patch repairs that,
      and allows test_cpickle.py (to which I added a relevant test case earlier
      today) to work again on sizeof(long)==8 boxes.
      There's another (at least one) sizeof(long)==8 binary pickle bug, but in
      pickle.py instead.  That bug is still there, and test_pickle.py doesn't
      catch it yet (try pickling and unpickling, e.g., 1 << 46).
      e93cc859
  2. 09 Apr, 2001 17 commits
  3. 08 Apr, 2001 6 commits
  4. 07 Apr, 2001 6 commits
  5. 06 Apr, 2001 3 commits