1. 16 Eyl, 2002 1 kayıt (commit)
  2. 14 Agu, 2002 1 kayıt (commit)
  3. 13 Agu, 2002 1 kayıt (commit)
  4. 04 Agu, 2002 1 kayıt (commit)
  5. 02 Agu, 2002 1 kayıt (commit)
  6. 18 Tem, 2002 1 kayıt (commit)
  7. 17 Tem, 2002 1 kayıt (commit)
    • Jeremy Hylton's avatar
      staticforward bites the dust. · 938ace69
      Jeremy Hylton yazdı
      The staticforward define was needed to support certain broken C
      compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
      static keyword when it was used with a forward declaration of a static
      initialized structure.  Standard C allows the forward declaration with
      static, and we've decided to stop catering to broken C compilers.  (In
      fact, we expect that the compilers are all fixed eight years later.)
      
      I'm leaving staticforward and statichere defined in object.h as
      static.  This is only for backwards compatibility with C extensions
      that might still use it.
      
      XXX I haven't updated the documentation.
      938ace69
  8. 16 Tem, 2002 1 kayıt (commit)
  9. 11 Tem, 2002 2 kayıt (commit)
  10. 26 Haz, 2002 1 kayıt (commit)
  11. 13 Haz, 2002 1 kayıt (commit)
  12. 01 May, 2002 1 kayıt (commit)
  13. 27 Nis, 2002 1 kayıt (commit)
    • Tim Peters's avatar
      Repair widespread misuse of _PyString_Resize. Since it's clear people · 5de9842b
      Tim Peters yazdı
      don't understand how this function works, also beefed up the docs.  The
      most common usage error is of this form (often spread out across gotos):
      
      	if (_PyString_Resize(&s, n) < 0) {
      		Py_DECREF(s);
      		s = NULL;
      		goto outtahere;
      	}
      
      The error is that if _PyString_Resize runs out of memory, it automatically
      decrefs the input string object s (which also deallocates it, since its
      refcount must be 1 upon entry), and sets s to NULL.  So if the "if"
      branch ever triggers, it's an error to call Py_DECREF(s):  s is already
      NULL!  A correct way to write the above is the simpler (and intended)
      
      	if (_PyString_Resize(&s, n) < 0)
      		goto outtahere;
      
      Bugfix candidate.
      5de9842b
  14. 21 Nis, 2002 1 kayıt (commit)
  15. 05 Nis, 2002 1 kayıt (commit)
    • Guido van Rossum's avatar
      Implement an idea by Paul Rubin: · e276339c
      Guido van Rossum yazdı
      Change pickling format for bools to use a backwards compatible
      encoding.  This means you can pickle True or False on Python 2.3
      and Python 2.2 or before will read it back as 1 or 0.  The code
      used for pickling bools before would create pickles that could
      not be read in previous Python versions.
      e276339c
  16. 04 Nis, 2002 1 kayıt (commit)
  17. 03 Nis, 2002 1 kayıt (commit)
    • Guido van Rossum's avatar
      Add the 'bool' type and its values 'False' and 'True', as described in · 77f6a65e
      Guido van Rossum yazdı
      PEP 285.  Everything described in the PEP is here, and there is even
      some documentation.  I had to fix 12 unit tests; all but one of these
      were printing Boolean outcomes that changed from 0/1 to False/True.
      (The exception is test_unicode.py, which did a type(x) == type(y)
      style comparison.  I could've fixed that with a single line using
      issubtype(x, type(y)), but instead chose to be explicit about those
      places where a bool is expected.
      
      Still to do: perhaps more documentation; change standard library
      modules to return False/True from predicates.
      77f6a65e
  18. 01 Nis, 2002 2 kayıt (commit)
  19. 31 Mar, 2002 1 kayıt (commit)
  20. 22 Mar, 2002 1 kayıt (commit)
  21. 21 Ara, 2001 1 kayıt (commit)
  22. 19 Ara, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      save(): Fix for SF bug #494904: Cannot pickle a class with a · 950dce6f
      Guido van Rossum yazdı
      metaclass, reported by Dan Parisien.
      
      Objects that are instances of custom metaclasses, i.e. whose ob_type
      is a subclass of PyType_Type, should be pickled the same as new-style
      classes (objects whose ob_type is PyType_Type).  This can't be done
      through the existing dispatch switches, and the __reduce__ trick
      doesn't work for these, since it finds the unbound __reduce__ for
      instances of the class (inherited from PyBaseObject_Type).  So check
      explicitly using PyType_IsSubtype().
      950dce6f
  23. 08 Ara, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      Patch supplied by Burton Radons for his own SF bug #487390: Modifying · 14648396
      Guido van Rossum yazdı
      type.__module__ behavior.
      
      This adds the module name and a dot in front of the type name in every
      type object initializer, except for built-in types (and those that
      already had this).  Note that it touches lots of Mac modules -- I have
      no way to test these but the changes look right.  Apologies if they're
      not.  This also touches the weakref docs, which contains a sample type
      object initializer.  It also touches the mmap test output, because the
      mmap type's repr is included in that output.  It touches object.h to
      put the correct description in a comment.
      14648396
  24. 28 Kas, 2001 1 kayıt (commit)
  25. 15 Kas, 2001 1 kayıt (commit)
    • Barry Warsaw's avatar
      A change to sync with pickle.py: · 9b481ff3
      Barry Warsaw yazdı
      find_class(): We no longer mask all exceptions[1] by transforming them
      into SystemError.  The latter is definitely not the right thing to do,
      so we let any exceptions that occur in the PyObject_GetAttr() call to
      simply propagate up if they occur.
      
      [1] Note that pickle only masked ImportError, KeyError, and
      AttributeError, but cPickle masked all exceptions.
      9b481ff3
  26. 12 Kas, 2001 1 kayıt (commit)
  27. 09 Kas, 2001 1 kayıt (commit)
  28. 16 Eki, 2001 1 kayıt (commit)
  29. 15 Eki, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Better fix for core dumps on recursive objects in fast mode. · 499ab6a6
      Jeremy Hylton yazdı
      Raise ValueError when an object contains an arbitrarily nested
      reference to itself.  (The previous fix just produced invalid
      pickles.)
      
      Solution is very much like Py_ReprEnter() and Py_ReprLeave():
      fast_save_enter() and fast_save_leave() that tracks the fast_container
      limit and keeps a fast_memo of objects currently being pickled.
      
      The cost of the solution is moderately expensive for deeply nested
      structures, but it still seems to be faster than normal pickling,
      based on tests with deeply nested lists.
      
      Once FAST_LIMIT is exceeded, the new code is about twice as slow as
      fast-mode code that doesn't check for recursion.  It's still twice as
      fast as the normal pickling code.  In the absence of deeply nested
      structures, I couldn't measure a difference.
      499ab6a6
  30. 12 Eki, 2001 1 kayıt (commit)
    • Jeremy Hylton's avatar
      Progress on SF bug #466175 and general cleanup. · a0fb177b
      Jeremy Hylton yazdı
      Add a fast_container member to Picklerobject.  If fast is true, then
      fast_container counts the depth of nested container calls.  If the
      depth exceeds FAST_LIMIT (2000), the fast flag is ignored and the
      normal checks occur.  This approach is much like the approach for
      prevent stack overflow for comparison and reprs of recursive objects
      (e.g. [[...]]).
      
          - Fast container used for save_list(), save_dict(), and
            save_inst().
      
            XXX Not clear which other save_xxx() functions should use it.
      
      Make Picklerobject into new-style types, using PyObject_GenericGetAttr()
      and PyObject_GenericSetAttr().
      
          - Use PyMemberDef for binary and fast members
      
          - Use PyGetSetDef for persistent_id, inst_persistent_id, memo, and
            PicklingError.
      
            XXX Not all of these seem like they need to use getset, but it's
            not clear why the old getattr() and setattr() had such odd
            semantics.  One change is that the getvalue() attribute will
            exist on all Picklers, not just list-based picklers; I think
            this is a more rationale interface.
      
      There is a long laundry list of other changes:
      
          - Remove unused #defines for PyList_SET_ITEM() etc.
      
          - Make some of the indentation consistent
      
          - Replace uses of cPickle_PyMapping_HasKey() where the first
            argument is self->memo with calls to PyDict_GetItem(), because
            self->memo must be a dictionary.
      
          - Don't bother to check if cPickle_PyMapping_HasKey() returns < 0,
            because it can only return 0 or 1.
      
          - Replace uses of PyObject_CallObject() with PyObject_Call(), when
            we can guarantee that the argument tuple is really a tuple.
      
      Performance impacts of these changes:
      
          - 5% speedup for normal pickling
      
          - No change to fast-mode pickling.
      
      XXX Really need tests for all the features in cPickle that aren't in
      pickle.
      a0fb177b
  31. 28 Agu, 2001 1 kayıt (commit)
  32. 18 Agu, 2001 1 kayıt (commit)
    • Guido van Rossum's avatar
      SF patch #452239 by Gordon McMillan, to fix SF bug #451547. · a92d16aa
      Guido van Rossum yazdı
         This patch attempts to do to cPickle what Guido did
         for pickle.py v 1.50. That is: save_global tries
         importing the module, and fetching the name from the
         module. If that fails, or the returned object is not
         the same one we started with, it raises a
         PicklingError. (All this so pickling a lambda will
         fail at save time, rather than load time).
      a92d16aa
  33. 17 Agu, 2001 1 kayıt (commit)
    • Martin v. Löwis's avatar
      Patch #445762: Support --disable-unicode · 339d0f72
      Martin v. Löwis yazdı
      - Do not compile unicodeobject, unicodectype, and unicodedata if Unicode is disabled
      - check for Py_USING_UNICODE in all places that use Unicode functions
      - disables unicode literals, and the builtin functions
      - add the types.StringTypes list
      - remove Unicode literals from most tests.
      339d0f72
  34. 02 Agu, 2001 1 kayıt (commit)
  35. 17 Tem, 2001 1 kayıt (commit)
  36. 10 Nis, 2001 3 kayıt (commit)
    • Tim Peters's avatar
      Ack -- this module mixes tabs and spaces, and what appears to be a mix · d8ae7c29
      Tim Peters yazdı
      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.
      d8ae7c29
    • Tim Peters's avatar
      On a sizeof(long)==8 machine, ints in range(2**31, 2**32) were getting · 3906eb87
      Tim Peters yazdı
      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.
      3906eb87
    • Tim Peters's avatar
      Critical fix: if cPickle on a sizeof(long)==8 box is used to read a · bfa18f71
      Tim Peters yazdı
      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).
      bfa18f71