Commit Graph

12603 Commits

Author SHA1 Message Date
Greg Ward d80506c238 Merged in code from the 0.1.5 release to handle IOError and OSError
exceptions better.
2000-04-22 03:20:49 +00:00
Greg Ward 6a9a545ab1 Check that 'self.formats' is good early on. 2000-04-22 03:11:55 +00:00
Greg Ward ddad73bca9 Catch DistutilsOptionError in 'setup()' -- it's thrown either because of
errors in the setup script or on the command line, so shouldn't result
in a traceback.
2000-04-22 03:11:17 +00:00
Greg Ward db80754abc Extracted the "what-do-I-do-for-this-format" logic from code in
'make_archive()' to a global static dictionary, ARCHIVE_FORMATS.
Added 'check_archive_formats()', which obviously makes good use of
  this dictionary.
2000-04-22 03:09:56 +00:00
Greg Ward 4982f98bc9 Fix how we generate the meta-data query methods to include 'get_fullname()'
and the other "composite meta-data" methods.
2000-04-22 02:52:44 +00:00
Greg Ward 0ae7f76b40 Changed to call 'get_fullname()', not 'get_full_name()', on Distribution object. 2000-04-22 02:51:25 +00:00
Jack Jansen ee0810403d Made the GUSI options work again with GUSI 2. 2000-04-21 23:53:37 +00:00
Guido van Rossum 6dd9fc1a2c Added winsound project to workspace, and added -I options to winsound 2000-04-21 21:43:40 +00:00
Guido van Rossum 5796d26794 Patch by Vladimir Marangozov to unload additionally imported modules
after each test has been run.  This avoids excessive memory growth
during the tests.
2000-04-21 21:35:06 +00:00
Guido van Rossum cdd092fe48 Added test_winsound by Mark Hammond. 2000-04-21 21:28:47 +00:00
Guido van Rossum a8ee4c31bf Mark Hammond:
* 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.
2000-04-21 21:26:43 +00:00
Guido van Rossum 7053b8a422 Mark Hammond:
* 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.
2000-04-21 21:26:08 +00:00
Guido van Rossum 25826c93c4 Charles Waldman writes:
"""
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]
2000-04-21 21:17:39 +00:00
Guido van Rossum 5ce78f8e4e Patch by Charles G Waldman to avoid a sneaky memory leak in
_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.
"""
2000-04-21 21:15:05 +00:00
Guido van Rossum 84219682fb Charles Waldman writes:
"""
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.
"""
2000-04-21 20:49:58 +00:00
Guido van Rossum 83addc7a0f Charles Waldman writes:
"""
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.
"""
2000-04-21 20:49:36 +00:00
Guido van Rossum 2dd8dddef4 Use an explicit macro SOCKETCLOSE which expands to closesocket (on
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.)
2000-04-21 20:33:00 +00:00
Guido van Rossum ace88aebbb Patch by Brian Hooper, somewhat augmented by GvR, to strip a trailing
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!)
2000-04-21 18:54:45 +00:00
Guido van Rossum e0cd291b81 Doc strings for the spawn* functions, by Michael Hudson. 2000-04-21 18:35:36 +00:00
Greg Ward 535f2d9ace Fix 'check_metadata()' so it grovels through the distribution's metadata
object, rather than through the distribution itself (since I moved the meta-
data out to a DistributionMetadata instance).
2000-04-21 04:37:12 +00:00
Greg Ward 87da1ea127 Patch from Andrew Kuchling: document the new multiple pattern feature in the
manifest template.
2000-04-21 04:35:25 +00:00
Greg Ward 9d5afa9894 Patch from Andrew Kuchling: allow multiple include/exclude patterns
for all commands except 'prune' and 'graft'.
2000-04-21 04:31:10 +00:00
Greg Ward 58ec6ede20 Fixed the '--license' option so it's officially an alias for '--licence',
and now actually works.
2000-04-21 04:22:49 +00:00
Greg Ward 1e7b509526 Added the capability for alias options. 2000-04-21 04:22:01 +00:00
Greg Ward 320df700dc Added 'has_option()', 'get_attr_name()' methods. 2000-04-21 02:31:07 +00:00
Greg Ward 82715e1f11 Patch, originally from Bastian Kleineidam and savagely mutilated by me,
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.
2000-04-21 02:28:14 +00:00
Greg Ward 283c745c57 Made 'generate_help()' and 'print_help()' methods of FancyGetopt.
Added 'set_option_table()' method.
Added missing 'self' to 'get_option_order()'.
Cosmetic/comment/docstring tweaks.
2000-04-21 02:09:26 +00:00
Greg Ward ead5c291bb Continuing the refactoring: deleted the old 'fancy_getopt()' function,
leaving in its place a tiny wrapper around the FancyGetopt class
for backwards compatibility.
2000-04-21 01:44:00 +00:00
Greg Ward ffc10d9a2e Hefty refactoring: converted 'fancy_getopt()' function into FancyGetopt
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.)
2000-04-21 01:41:54 +00:00
Greg Ward d5767a5e43 Reformatted wide paragraphs. 2000-04-19 22:48:09 +00:00
Greg Ward 4eaa3bfed0 Reverted '\var' in the "standard installation location" table to '\filevar'.
Reformatted wide paragraphs.
2000-04-19 22:44:25 +00:00
Greg Ward c402fa122f Dropped '\tilde' and '\bslash' definitions. 2000-04-19 22:40:34 +00:00
Greg Ward 4756e5fb1c Changed '\tilde' and '\bslash' to the standard '\textasciitilde' and
'\textbackslash'.
2000-04-19 22:40:12 +00:00
Greg Ward 95da443447 Removed '\package' definition. 2000-04-19 22:36:33 +00:00
Greg Ward 1ecc251538 Changed '\package' to \module'. 2000-04-19 22:36:24 +00:00
Greg Ward a021acacfb Changed '\option' to '\longprogramopt' wherever it referred to a command-line
option.
2000-04-19 22:34:11 +00:00
Fred Drake ff9ea480eb ANSI-fy & de-tabify the source.
(4-space indents already used.)
2000-04-19 13:54:15 +00:00
Greg Ward 3314c8efc9 Bumped version to 0.8.1. 2000-04-19 02:23:21 +00:00
Greg Ward b1e4a6e101 Added kludge to deal with the "./ld_so_aix" problem: force all strings
in the Makefile that start with "./" to be absolute paths (with the
implied root being the directory where the Makefile itself was found).
2000-04-19 02:22:07 +00:00
Greg Ward 434ef8fe94 Don't load the config.h file, even under Unix, because we never use the
information from config.h.  Code is still there in case someone in the
future needs to parse an autoconf-generated config.h file.
2000-04-19 02:18:09 +00:00
Greg Ward f70c603149 Added 'link_executable()' method (Berthold Hoellmann).
Two small fixes to 'link_shared_object()'.
2000-04-19 02:16:49 +00:00
Jack Jansen 316778860f Fix by Dan Green and Corran Webster to support LongDateTime
values. Untested by me.
2000-04-18 14:08:31 +00:00
Fred Drake cebda6f5f0 Added documentation for WindowsError; omission noted by Michal Bozon
<bozon@natur.cuni.cz>.

(Mark Hammond, other Python/Windows cognoscenti: please check this!)
2000-04-17 17:42:00 +00:00
Fred Drake e99d1dbc74 Clarify the description of the else clause for try/except, and add an
explanation of why you'd want to use it.

Based on a question from Michael Simcich <msimcich@accesstools.com>.
2000-04-17 14:56:31 +00:00
Greg Ward eacdea8572 Reformatted all exception documentation as docstrings. 2000-04-15 22:23:47 +00:00
Greg Ward 02a1a2b077 Cleaned up/simplified error-handling:
- 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
2000-04-15 22:15:07 +00:00
Jeremy Hylton 4a3dd2dcc2 Fix PR#7 comparisons of recursive objects
Note that comparisons of deeply nested objects can still dump core in
extreme cases.
2000-04-14 19:13:24 +00:00
Fred Drake 0556501a81 Anthony Baxter <anthony@interlink.com.au>:
The following adds support for RTSP (RFC2326) URLs to the standard
urlparse.py module.

(Augmented by FLD to include rtspu:, specified in the same RFC & OK'd
by Anthony.)
2000-04-14 14:01:34 +00:00
Greg Ward 8eef583025 Don't run "ranlib" if sysconfig's RANLIB (from Python's Makefile) starts
with ":".
2000-04-14 13:53:34 +00:00
Greg Ward 46b98e35fd Various wording/formattin tweaks.
Started spewing "Creating Built Distributions" section.
2000-04-14 01:53:36 +00:00