1. 13 Oct, 2001 18 commits
  2. 12 Oct, 2001 19 commits
    • Martin v. Löwis's avatar
      Correct __repr__: include module name, avoid extra space for empty status, · 106bdd3b
      Martin v. Löwis authored
      use 0x format for id. Proposed by Cesar Eduardo Barros in patch #470680.
      106bdd3b
    • Guido van Rossum's avatar
      SF patch #467455 : Enhanced environment variables, by Toby Dickenson. · 9abaf4d3
      Guido van Rossum authored
         This patch changes to logic to:
      
         if env.var. set and non-empty:
             if env.var. is an integer:
                 set flag to that integer
         if flag is zero: # [actually, <= 0 --GvR]
             set flag to 1
      
         Under this patch, anyone currently using
         PYTHONVERBOSE=yes will get the same output as before.
      
         PYTHONVERBNOSE=2 will generate more verbosity than
         before.
      
         The only unusual case that the following three are
         still all equivalent:
         PYTHONVERBOSE=yespleas
         PYTHONVERBOSE=1
         PYTHONVERBOSE=0
      9abaf4d3
    • Tim Peters's avatar
      Get hotshot closer to compiling on Windows. · 1566a17a
      Tim Peters authored
      Still broken:  GETTIMEOFDAY.  This macro obviously isn't being defined
      on Windows, so there's logic errors here I'd rather Fred untangled.
      1566a17a
    • Guido van Rossum's avatar
      Jason Lowe · 3e996436
      Guido van Rossum authored
      3e996436
    • Guido van Rossum's avatar
      Add SF patch #468347 -- mask signals for non-main pthreads, by Jason Lowe: · 80230998
      Guido van Rossum authored
         This patch updates Python/thread_pthread.h to mask all
         signals for any thread created. This will keep all
         signals masked for any thread that isn't the initial
         thread. For Solaris and Linux, the two platforms I was
         able to test it on, it solves bug #465673 (pthreads
         need signal protection) and probably will solve bug
         #219772 (Interactive InterPreter+ Thread -> core dump
         at exit).
      
         I'd be great if this could get some testing on other
         platforms, especially HP-UX pre 11.00 and post 11.00,
         as I had to make some guesses for the DCE thread case.
         AIX is also a concern as I saw some mention of using
         sigthreadmask() as a pthread_sigmask() equivalent, but
         this patch doesn't use sigthreadmask(). I don't have
         access to AIX.
      80230998
    • Fred Drake's avatar
      Add entry for HotShot. · 3a40f32a
      Fred Drake authored
      3a40f32a
    • Fred Drake's avatar
      The HotShot core: look, ma, no hands! · 8c081a15
      Fred Drake authored
      8c081a15
    • Fred Drake's avatar
      Preliminary user-level interface to HotShot. We still need the analysis · f019324b
      Fred Drake authored
      tool; look for that on Monday.
      f019324b
    • Fred Drake's avatar
      A most trivial test for HotShot -- make sure we get reasonable events · de3cdcad
      Fred Drake authored
      reported and can read the log back in.
      de3cdcad
    • Guido van Rossum's avatar
      bca8c2eb
    • Guido van Rossum's avatar
      Band-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's. · 79fd0fca
      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.
      79fd0fca
    • Fred Drake's avatar
      Add entries for the newly split C API manual. · c65b3d95
      Fred Drake authored
      c65b3d95
    • Fred Drake's avatar
      Break the Python/C API manual into smaller files by chapter. This manual · 3adf79e3
      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.
      3adf79e3
    • Guido van Rossum's avatar
      PySocket_getaddrinfo(): fix two refcount bugs, both having to do with · 716aac04
      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.)
      716aac04
    • Guido van Rossum's avatar
      27b7f9f9
    • Guido van Rossum's avatar
      Suggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et · ea32cbb2
      Guido van Rossum authored
      al. if already set.  Also adds TIX_LIBRARY (just in case).
      (Note that this is entirely Windows specific.)
      ea32cbb2
    • Guido van Rossum's avatar
    • Jeremy Hylton's avatar
      Progress on SF bug #466175 and general cleanup. · a0fb177b
      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.
      a0fb177b
    • Tim Peters's avatar
      SF bug [#470040] ParseTuple t# vs subclasses. · fc57ccb9
      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.
      fc57ccb9
  3. 11 Oct, 2001 3 commits
    • Martin v. Löwis's avatar
      401a76dc
    • Guido van Rossum's avatar
      Another step in the right direction: when a new class's attribute · 875eeaa1
      Guido van Rossum authored
      corresponding to a dispatch slot (e.g. __getitem__ or __add__) is set,
      calculate the proper dispatch slot and propagate the change to all
      subclasses.  Because of multiple inheritance, there's no easy way to
      avoid always recursing down the tree of subclasses.  Who cares?
      
      (There's more to do, but this works.  There's also a test for this now.)
      875eeaa1
    • Tim Peters's avatar
      SF bug [#467145] Python 2.2a4 build problem on HPUX 11.0. · 9e4ca10c
      Tim Peters authored
      The platform requires 8-byte alignment for doubles, but the GC header
      was 12 bytes and that threw off the natural alignment of the double
      members of a subtype of complex.  The fix puts the GC header into a
      union with a double as the other member, to force no-looser-than
      double alignment of GC headers.  On boxes that require 8-byte alignment
      for doubles, this may add pad bytes to the GC header accordingly; ditto
      for platforms that *prefer* 8-byte alignment for doubles.  On platforms
      that don't care, it shouldn't change the memory layout (because the
      size of the old GC header is certainly greater than the size of a double
      on all platforms, so unioning with a double shouldn't change size or
      alignment on such boxes).
      9e4ca10c