Commit Graph

12539 Commits

Author SHA1 Message Date
Guido van Rossum 7da3cc5dfb Michael Hudson:
I think that after this patch, all objects in the os module (with names
that don't start with "_") that can have docstrings, do, on Linux at
least.

Also fix a nit in one of my spawn* docstrings.
2000-04-25 10:53:22 +00:00
Fred Drake e7ab64e070 validate_arglist(): Re-written to reflect extended call syntax.
validate_numnodes():  Added comment to explain the sometimes idiomatic
        usage pattern.
2000-04-25 04:14:46 +00:00
Guido van Rossum c35a20ed1e Mark Hammond: Added dependency of winsound project on python16
project.  [However I didn't add the other changes in his patch, which
were just taking away the source code control stuff -- this doesn't
hurt and would come back as soon as I make another change. --GvR]
2000-04-25 03:24:06 +00:00
Greg Ward 4a9e72266d Added section headers for "Extending the Distutils" section (just
a reminder to myself).
2000-04-25 02:57:36 +00:00
Greg Ward a74ce01c98 Bumped version to 0.8.2. 2000-04-25 01:55:58 +00:00
Greg Ward f194878d6a Harry Henry Gebel:
Adds bztar format to generate .tar.bz2 tarballs

Uses the -f argument to overright old tarballs automatically, I am
assuming that if the old tarball was wanted it would have been moved or
else the version number would have been changed.

Uses the -9 argument to bzip2 and gzip to use maximum
compression. Compress uses the maximum compression by default.

Tests for correct value for the 'compress' argument of make_tarball. This
is one less place for someone adding new compression programs to forget to
change.
2000-04-25 01:38:20 +00:00
Greg Ward 464023fb64 Lyle Johnson: fixed broken logic in 'native_path()'. 2000-04-25 01:33:11 +00:00
Guido van Rossum e92e610a9e Christian Tismer -- total rewrite on trashcan code.
Improvements:
- does no longer need any extra memory
- has no relationship to tstate
- works in debug mode
- can easily be modified for free threading (hi Greg:)

Side effects:
Trashcan does change the order of object destruction.
Prevending that would be quite an immense effort, as
my attempts have shown. This version works always
the same, with debug mode or not. The slightly
changed destruction order should therefore be no problem.

Algorithm:
While the old idea of delaying the destruction of some
obejcts at a certain recursion level was kept, we now
no longer aloocate an object to hold these objects.
The delayed objects are instead chained together
via their ob_type field. The type is encoded via
ob_refcnt. When it comes to the destruction of the
chain of waiting objects, the topmost object is popped
off the chain and revived with type and refcount 1,
then it gets a normal Py_DECREF.

I am confident that this solution is near optimum
for minimizing side effects and code bloat.
2000-04-24 15:40:53 +00:00
Guido van Rossum db575db0d6 Add definition of socklen_t so that socketmodule.c will compile on Windows. 2000-04-24 15:37:34 +00:00
Guido van Rossum ff3ab42c04 Jack Jansen: The GUSI 2.0 I/O library used on the Mac uses the
socklen_t (unsigned int) for most size parameters.  Apparently this is
part of the UNIX 98 standard.

[GvR: the changes to configure.in etc. that I just checked in make
sure that socklen_t is defined everywhere, so I deleted the little
part of Jack's mod to define socklen_t if not in GUSI2.  I suppose I
will have to add it to the Windows config.h in a minute.]
2000-04-24 15:16:03 +00:00
Guido van Rossum ddc3b63bf6 Jack Jansen: The GUSI 2.0 I/O library (which is used on the Mac)
doesn't use the special header file for select anymore.
2000-04-24 15:12:54 +00:00
Guido van Rossum 59903fe2b5 Added tests for socklen_t 2000-04-24 15:12:04 +00:00
Guido van Rossum b33aa1a51e Jack Jansen: The new version of the GUSI i/o library on the Macintosh
has a few slightly different calls from the old one.
2000-04-24 15:08:18 +00:00
Guido van Rossum 095249fc8c Jack Jansen: Posix threads are now supported on the Macintosh too. 2000-04-24 15:06:51 +00:00
Guido van Rossum 0f7bd3ce9f Added site-packages. (Sorry, forgot who submitted this patch.) 2000-04-24 14:57:21 +00:00
Guido van Rossum e56b4cf804 Jack Jansen: A few new types needed by new API calls. 2000-04-24 14:56:00 +00:00
Guido van Rossum 1d8fcdacea Oops -- Mark forgot to add "0x" to the /base: argument. 2000-04-24 14:17:17 +00:00
Andrew M. Kuchling 43c5af026f Fix to previous patch: send the request data when it's provided 2000-04-24 14:17:06 +00:00
Guido van Rossum c1488413e4 Added a provision to stop all threads before exiting from the test:
the change to regrtest.py to unload all newly imported modules did
something bad to the threads -- and I realized that they would never
stop!
2000-04-24 14:07:03 +00:00
Guido van Rossum 9d90a94faf Remove Windows line endings. 2000-04-24 14:02:15 +00:00
Guido van Rossum 2512d6d83a Fix spelling error and remove Windows line endings. 2000-04-24 14:01:51 +00:00
Guido van Rossum 841c2f6b09 Changes by Mark Hammond to ignore more by-products of the build. 2000-04-24 13:32:05 +00:00
Guido van Rossum 00f09b3821 Security patch for Unix by Chris McDonough.
This uses the same precautions when trying to find a temporary
directory as when the actual tempfile is created (using O_CREAT and
O_EXCL).  On non-posix platforms, nothing is changed.
2000-04-24 13:28:02 +00:00
Jack Jansen bfbf113827 Don't build the _tkinter project from Build, only the one from Extensions:Imaging, which now drops its resulting .slb into the PlugIns folder. 2000-04-23 22:13:15 +00:00
Jack Jansen 322e158140 Tk 8.3.0 resources. 2000-04-23 22:12:13 +00:00
Jack Jansen 3c6f0e6230 Fixed to work with Tcl/Tk 8.3.0, at least, my modified copy of it. 2000-04-23 22:11:36 +00:00
Andrew M. Kuchling 141e9894b7 Fixed bug reported by JP Calderone: https:// URL's didn't work.
The fix also adds support for POSTing to an https URL
2000-04-23 02:53:11 +00:00
Greg Ward 66bf446273 Patch from Harry Henry Gebel: fix two stupid bugs in help-printing stuff. 2000-04-23 02:50:45 +00:00
Jack Jansen 01ae9eb2ec Added a couple of contributors. Still needs work for the next distribution. 2000-04-22 22:57:25 +00:00
Jack Jansen 6a2fdabd3d Erik van Blokland's CaptureAE. 2000-04-22 22:56:53 +00:00
Jack Jansen 2ea47f9f70 Added a reference to the Open Directory page on macPython. 2000-04-22 22:56:09 +00:00
Jack Jansen 82add28b40 The .exp file hadn't been regenerated after adding the threading stuff. This means that building a nonthreaded PythonCore will now require massaging of the .exp. 2000-04-22 21:51:47 +00:00
Jack Jansen 2f2c5f6471 Added a note about Personal Webserver, and replaced "netpresenz" by a list of the current mac webservers. 2000-04-22 21:50:33 +00:00
Jack Jansen 968cde98fc Added Corran Webster's explanation of how to write extensions in MPW and a pointer to his W documentation. 2000-04-22 21:48:56 +00:00
Greg Ward 3af07e9a78 Sporadic, untested Python 1.5.1 compatibility changes. 2000-04-22 15:17:14 +00:00
Greg Ward aa458bc465 Merged in Python 1.5.1 compatibility changes from the 0.1.3 branch:
added 'abspath()' and 'extend()'.
2000-04-22 15:14:58 +00:00
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