1. 12 Oct, 2001 14 commits
    • Fred Drake's avatar
      Add entry for HotShot. · 3c0292bc
      Fred Drake authored
      3c0292bc
    • Fred Drake's avatar
      The HotShot core: look, ma, no hands! · feec6ce6
      Fred Drake authored
      feec6ce6
    • Fred Drake's avatar
      Preliminary user-level interface to HotShot. We still need the analysis · 61603173
      Fred Drake authored
      tool; look for that on Monday.
      61603173
    • Fred Drake's avatar
      A most trivial test for HotShot -- make sure we get reasonable events · 0fb8c7ef
      Fred Drake authored
      reported and can read the log back in.
      0fb8c7ef
    • Guido van Rossum's avatar
      6c178c7d
    • Guido van Rossum's avatar
      Band-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's. · 10357258
      Guido van Rossum authored
      The problem is that if fread() returns a short count, we attempt
      another fread() the next time through the loop, and apparently glibc
      clears or ignores the eof condition so the second fread() requires
      another ^D to make it see the eof condition.
      
      According to the man page (and the C std, I hope) fread() can only
      return a short count on error or eof.  I'm using that in the band-aid
      solution to avoid calling fread() a second time after a short read.
      
      Note that xreadlines() still has this problem: it calls
      readlines(sizehint) until it gets a zero-length return.  Since
      xreadlines() is mostly used for reading real files, I won't worry
      about this until we get a bug report.
      10357258
    • Fred Drake's avatar
      Add entries for the newly split C API manual. · a5cd7bfa
      Fred Drake authored
      a5cd7bfa
    • Fred Drake's avatar
      Break the Python/C API manual into smaller files by chapter. This manual · d573f63b
      Fred Drake authored
      has grown beyond what font-lock will work with using the default (X)Emacs
      settings.
      
      Indentation of the description has been made consistent, and a number of
      smaller markup adjustments have been made as well.
      d573f63b
    • Guido van Rossum's avatar
      PySocket_getaddrinfo(): fix two refcount bugs, both having to do with · 19a59019
      Guido van Rossum authored
      a misunderstanding of the refcont behavior of the 'O' format code in
      PyArg_ParseTuple() and Py_BuildValue(), respectively.
      
      - pobj is only a borrowed reference, so should *not* be DECREF'ed at
        the end.  This was the cause of SF bug #470635.
      
      - The Py_BuildValue() call would leak the object produced by
        makesockaddr().  (I found this by eyeballing the code.)
      19a59019
    • Guido van Rossum's avatar
      970debb7
    • Guido van Rossum's avatar
      Suggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et · ffa7aa04
      Guido van Rossum authored
      al. if already set.  Also adds TIX_LIBRARY (just in case).
      (Note that this is entirely Windows specific.)
      ffa7aa04
    • Guido van Rossum's avatar
    • Jeremy Hylton's avatar
      Progress on SF bug #466175 and general cleanup. · 9ffad9ee
      Jeremy Hylton authored
      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.
      9ffad9ee
    • Tim Peters's avatar
      SF bug [#470040] ParseTuple t# vs subclasses. · c2cae21e
      Tim Peters authored
      inherit_slots():  tp_as_buffer was getting inherited as if it were a
      method pointer, rather than a pointer to a vector of method pointers.  As
      a result, inheriting from a type that implemented buffer methods was
      ineffective, leaving all the tp_as_buffer slots NULL in the subclass.
      c2cae21e
  2. 11 Oct, 2001 15 commits
  3. 10 Oct, 2001 11 commits
    • Jeremy Hylton's avatar
      Lots of code reorganization with a few small API changes. · c537c47f
      Jeremy Hylton authored
      Change all the local names that start with SSL to start with PySSL.
      The OpenSSL library defines lots of calls that start with "SSL_".  The
      calls for Python's SSL objects also started with "SSL_".  This choice
      made it really confusing to figure out which calls were to the library
      and which calls were local to the file.
      
      Add PySSL_SetError() that sets an exception based on the information
      from SSL_get_error().  This function will eventually replace all the
      calls that set it with an error message that is based on the name of
      the call that failed rather than the reason it failed.  (Example: If
      SSL_connect() failed it used to report "SSL_connect error" now it will
      offer a specific message about why SSL_connect failed.)
      
          XXX It might be helpful to augment the error message generated
          below with the name of the SSL function that generated the error.
          I expect it's obvious most of the time.
      
      Remove several unnecessary INCREFs in the module's constructor call.
      PyDict_SetItem() and friends do the INCREF for you.
      c537c47f
    • Jeremy Hylton's avatar
      c953f257
    • Jeremy Hylton's avatar
    • Jack Jansen's avatar
      Rather gross workaround for a bug in the mac GUSI I/O library: · 51bc40fe
      Jack Jansen authored
      lseek(fp, 0L, SEEK_CUR) can make a filedescriptor unusable.
      This workaround is expected to last only a few weeks (until GUSI
      is fixed), but without it test_email fails.
      51bc40fe
    • Jack Jansen's avatar
    • Skip Montanaro's avatar
      allow long ints to be marshalled as ints - no check is made to the incoming · 39985232
      Skip Montanaro authored
      value, so the programmer will have to catch OverflowError.  I'm not sure
      what /F's perspective is on this.  Perhaps it should be caught and mapped to
      an xmlrpclib-specific exception.  None of the other type-specific dump
      methods seem to do any exception handling though.
      39985232
    • Guido van Rossum's avatar
      Fred's done with weakrefs · 050c0d70
      Guido van Rossum authored
      050c0d70
    • Tim Peters's avatar
      SF bug [#469732] os.path.walk docstring inconsistent. · 37918f66
      Tim Peters authored
      We have 5 implementations of walk(), and 5 different docstrings.  Combined
      'em.  Let's see how long it takes before they're all different again!
      37918f66
    • Jeremy Hylton's avatar
      In newSSLObject(), initialize the various members of an SSLObject to NULL. · 18db6dd0
      Jeremy Hylton authored
      In SSL_dealloc(), free/dealloc them only if they're non-NULL.
      
      Fixes some obvious core dumps, but not sure yet if there are more
      semantics to the SSL calls that would affect the dealloc.
      18db6dd0
    • Jeremy Hylton's avatar
      5442430a
    • Jeremy Hylton's avatar
      Fix two memory leaks in socket.ssl(). · e4f82d06
      Jeremy Hylton authored
      XXX [1] These changes aren't tested very thoroughly, because regrtest
      doesn't do any SSL tests.  I've done some trivial tests on my own, but
      don't really know how to use the key and cert files.  In one case, an
      SSL-level error causes Python to dump core.  I'll get the fixed in the
      next round of changes.
      
      XXX [2] The checkin removes the x_attr member of the SSLObject struct.
      I'm not sure if this is kosher for backwards compatibility at the
      binary level.  Perhaps its safer to keep the member but keep it
      assigned to NULL.
      
      And the leaks?
      
      newSSLObject() called PyDict_New(), stored the result in x_attr
      without checking it, and later stored NULL in x_attr without doing
      anything to the dict.  So the dict always leaks.  There is no further
      reference to x_attr, so I just removed it completely.
      
      The error cases in newSSLObject() passed the return value of
      PyString_FromString() directly to PyErr_SetObject().
      PyErr_SetObject() expects a borrowed reference, so the string leaked.
      e4f82d06