1. 21 Nis, 2000 23 kayıt (commit)
    • Jack Jansen's avatar
      ee081040
    • Guido van Rossum's avatar
    • Guido van Rossum's avatar
      Patch by Vladimir Marangozov to unload additionally imported modules · 5796d267
      Guido van Rossum yazdı
      after each test has been run.  This avoids excessive memory growth
      during the tests.
      5796d267
    • Guido van Rossum's avatar
      Added test_winsound by Mark Hammond. · cdd092fe
      Guido van Rossum yazdı
      cdd092fe
    • Guido van Rossum's avatar
      Mark Hammond: · a8ee4c31
      Guido van Rossum yazdı
      * Base address for all extension modules updated. PC\dllbase_nt.txt
      also updated.  Erroneous "libpath" directory removed for all
      projects.
      
      * winsound module moved from a builtin module to an extension
      module.  This was done primarily to avoid Python16.dll needing to
      pull in winmm.dll.  Really dumb test added for winsound - but if
      nothing else it ensures the module imports.
      a8ee4c31
    • Guido van Rossum's avatar
      Mark Hammond: · 7053b8a4
      Guido van Rossum yazdı
      * Temp directory for all projects are now specific to the project
      (rather than common as before).  This avoids any conflicts with
      debug symbols or common file names etc.
      NOTE: You should manually delete your existing build directory after
      applying this patch, as the MSVC "clean" command will now only clean
      the new temporary directories - not the existing common temp
      directory.
      
      * Base address for all extension modules updated. PC\dllbase_nt.txt
      also updated.  Erroneous "libpath" directory removed for all
      projects.
      
      * winsound module moved from a builtin module to an extension
      module.  This was done primarily to avoid Python16.dll needing to
      pull in winmm.dll.  Really dumb test added for winsound - but if
      nothing else it ensures the module imports.
      7053b8a4
    • Guido van Rossum's avatar
      Charles Waldman writes: · 25826c93
      Guido van Rossum yazdı
      """
      Running "test_extcall" repeatedly results in memory leaks.
      
      One of these can't be fixed (at least not easily!), it happens since
      this code:
      
      def saboteur(**kw):
          kw['x'] = locals()
      d = {}
      saboteur(a=1, **d)
      
      creates a circular reference - d['x']['d']==d
      
      The others are due to some missing decrefs in ceval.c, fixed by the
      patch attached below.
      
      Note:  I originally wrote this without the "goto", just adding the
      missing decref's where needed.  But I think the goto is justified in
      keeping the executable code size of ceval as small as possible.
      """
      
      [I think the circular reference is more like kw['x']['kw'] == kw. --GvR]
      25826c93
    • Guido van Rossum's avatar
      Patch by Charles G Waldman to avoid a sneaky memory leak in · 5ce78f8e
      Guido van Rossum yazdı
      _PyTuple_Resize().  In addition, a change suggested by Jeremy Hylton
      to limit the size of the free lists is also merged into this patch.
      
      Charles wrote initially:
      
      """
      Test Case:  run the following code:
      
      class Nothing:
          def __len__(self):
              return 5
          def __getitem__(self, i):
              if i < 3:
                  return i
              else:
                  raise IndexError, i
      
      def g(a,*b,**c):
          return
      
      for x in xrange(1000000):
          g(*Nothing())
      
      
      and watch Python's memory use go up and up.
      
      
      Diagnosis:
      
      The analysis begins with the call to PySequence_Tuple at line 1641 in
      ceval.c - the argument to g is seen to be a sequence but not a tuple,
      so it needs to be converted from an abstract sequence to a concrete
      tuple.  PySequence_Tuple starts off by creating a new tuple of length
      5 (line 1122 in abstract.c).  Then at line 1149, since only 3 elements
      were assigned, _PyTuple_Resize is called to make the 5-tuple into a
      3-tuple.  When we're all done the 3-tuple is decrefed, but rather than
      being freed it is placed on the free_tuples cache.
      
      The basic problem is that the 3-tuples are being added to the cache
      but never picked up again, since _PyTuple_Resize doesn't make use of
      the free_tuples cache.  If you are resizing a 5-tuple to a 3-tuple and
      there is already a 3-tuple in free_tuples[3], instead of using this
      tuple, _PyTuple_Resize will realloc the 5-tuple to a 3-tuple.  It
      would more efficient to use the existing 3-tuple and cache the
      5-tuple.
      
      By making _PyTuple_Resize aware of the free_tuples (just as
      PyTuple_New), we not only save a few calls to realloc, but also
      prevent this misbehavior whereby tuples are being added to the
      free_tuples list but never properly "recycled".
      """
      
      And later:
      
      """
      This patch replaces my submission of Sun, 16 Apr and addresses Jeremy
      Hylton's suggestions that we also limit the size of the free tuple
      list.  I chose 2000 as the maximum number of tuples of any particular
      size to save.
      
      There was also a problem with the previous version of this patch
      causing a core dump if Python was built with Py_TRACE_REFS.  This is
      fixed in the below version of the patch, which uses tupledealloc
      instead of _Py_Dealloc.
      """
      5ce78f8e
    • Guido van Rossum's avatar
      Charles Waldman writes: · 84219682
      Guido van Rossum yazdı
      """
      In the course of debugging this I also saw that cPickle is
      inconsistent with pickle - if you attempt a pickle.load or pickle.dump
      on a closed file, you get a ValueError, whereas the corresponding
      cPickle operations give an IOError.  Since cPickle is advertised as
      being compatible with pickle, I changed these exceptions to match.
      """
      84219682
    • Guido van Rossum's avatar
      Charles Waldman writes: · 83addc7a
      Guido van Rossum yazdı
      """
      Problem description:
      
      	Run the following script:
      
      import test.test_cpickle
      for x in xrange(1000000):
          reload(test.test_cpickle)
      
      Watch Python's memory use go up up and away!
      
      In the course of debugging this I also saw that cPickle is
      inconsistent with pickle - if you attempt a pickle.load or pickle.dump
      on a closed file, you get a ValueError, whereas the corresponding
      cPickle operations give an IOError.  Since cPickle is advertised as
      being compatible with pickle, I changed these exceptions to match.
      """
      83addc7a
    • Guido van Rossum's avatar
      Use an explicit macro SOCKETCLOSE which expands to closesocket (on · 2dd8ddde
      Guido van Rossum yazdı
      Windows), soclose (on OS2), or to close (everywhere else).
      
      Hopefully this fixes a new compilation error that I suddenly get on
      Windows because the macro definition for close -> closesocket
      apparently was done before including io.h, which contains a prototype
      for close.  (No idea why this wasn't an error before.)
      2dd8ddde
    • Guido van Rossum's avatar
      Patch by Brian Hooper, somewhat augmented by GvR, to strip a trailing · ace88aeb
      Guido van Rossum yazdı
      backslash from the pathname argument to stat() on Windows -- while on
      Unix, stat("/bin/") succeeds and does the same thing as stat("/bin"),
      on Windows, stat("\\windows\\") fails while stat("\\windows") succeeds.
      This modified version of the patch recognizes both / and \.
      
      (This is odd behavior of the MS C library, since
      os.listdir("\\windows\\") succeeds!)
      ace88aeb
    • Guido van Rossum's avatar
    • Greg Ward's avatar
      Fix 'check_metadata()' so it grovels through the distribution's metadata · 535f2d9a
      Greg Ward yazdı
      object, rather than through the distribution itself (since I moved the meta-
      data out to a DistributionMetadata instance).
      535f2d9a
    • Greg Ward's avatar
      87da1ea1
    • Greg Ward's avatar
      Patch from Andrew Kuchling: allow multiple include/exclude patterns · 9d5afa98
      Greg Ward yazdı
      for all commands except 'prune' and 'graft'.
      9d5afa98
    • Greg Ward's avatar
      Fixed the '--license' option so it's officially an alias for '--licence', · 58ec6ede
      Greg Ward yazdı
      and now actually works.
      58ec6ede
    • Greg Ward's avatar
      Added the capability for alias options. · 1e7b5095
      Greg Ward yazdı
      1e7b5095
    • Greg Ward's avatar
      320df700
    • Greg Ward's avatar
      Patch, originally from Bastian Kleineidam and savagely mutilated by me, · 82715e1f
      Greg Ward yazdı
      to add the "display metadata" options: --name, --version, --author,
      and so forth.  Main changes:
        * added 'display_options' class attribute to list all the "display only"
          options (--help-commands plus the metadata options)
        * added DistributionMetadata class as a place to put the actual
          metadata information from the setup script (not to be confused with
          the metadata display options); the logic dealing with metadata
          (eg. return self.name or "UNKNOWN") is now  in this class
        * changed 'parse_command_line()' to use the new OO interface provided
          by fancy_getopt, mainly so we can get at the original order of
          options on the command line, so we can print multiple lines of
          distribution meta-data in the order specified by the user
        * added 'handle_display_options()' to handle display-only options
      Also fixed some crufty old comments/docstrings.
      82715e1f
    • Greg Ward's avatar
      Made 'generate_help()' and 'print_help()' methods of FancyGetopt. · 283c745c
      Greg Ward yazdı
      Added 'set_option_table()' method.
      Added missing 'self' to 'get_option_order()'.
      Cosmetic/comment/docstring tweaks.
      283c745c
    • Greg Ward's avatar
      Continuing the refactoring: deleted the old 'fancy_getopt()' function, · ead5c291
      Greg Ward yazdı
      leaving in its place a tiny wrapper around the FancyGetopt class
      for backwards compatibility.
      ead5c291
    • Greg Ward's avatar
      Hefty refactoring: converted 'fancy_getopt()' function into FancyGetopt · ffc10d9a
      Greg Ward yazdı
      class.  (Mainly this was to support the ability to go back after the
      getopt operation is done and get extra information about the parse,
      in particular the original order of options seen on the command line.
      But it's a big improvement and should make it a lot easier to add
      functionality in the future.)
      ffc10d9a
  2. 19 Nis, 2000 12 kayıt (commit)
  3. 18 Nis, 2000 1 kayıt (commit)
  4. 17 Nis, 2000 2 kayıt (commit)
  5. 15 Nis, 2000 2 kayıt (commit)
    • Greg Ward's avatar
      eacdea85
    • Greg Ward's avatar
      Cleaned up/simplified error-handling: · 02a1a2b0
      Greg Ward yazdı
        - DistutilsOptionError is now documented as it's actually used, ie.
          to indicate bogus option values (usually user options, eg. from
          the command-line)
        - added DistutilsSetupError to indicate errors that definitely arise
          in the setup script
        - got rid of DistutilsValueError, and changed all usage of it to
          either DistutilsSetupError or ValueError as appropriate
        - simplified a bunch of option get/set methods in Command and
          Distribution classes -- just pass on AttributeError most of
          the time, rather than turning it into something else
      02a1a2b0