Gregory P. Smith [Thu, 26 Feb 2004 10:07:14 +0000 (10:07 +0000)]
Fixes SF bug # 778421
* Fixed a bug in the compatibility interface set_location() method
where it would not properly search to the next nearest key when
used on BTree databases. [SF bug id 788421]
* Fixed a bug in the compatibility interface set_location() method
where it could crash when looking up keys in a hash or recno
format database due to an incorrect free().
Hye-Shik Chang [Tue, 24 Feb 2004 23:54:17 +0000 (23:54 +0000)]
Make _spawn_posix be ready for EINTR. waitpid(2) can be interrupted
by SIGCHLD or sth because no signal is masked before. This fixes
an optimized installation problem on FreeBSD libpthread.
Jeremy Hylton [Tue, 24 Feb 2004 19:40:35 +0000 (19:40 +0000)]
Fix two bugs in the new do_open() implementation for HTTPHandler.
Invoke the standard error handlers for non-200 responses.
Always supply a "Connection: close" header to prevent the server from
leaving the connection open. Downstream users of the socket may
attempt recv()/read() with no arguments, which would block if the
connection were kept open.
Thomas Heller [Fri, 20 Feb 2004 18:33:38 +0000 (18:33 +0000)]
wininst-6.exe and wininst-7.1.exe are in CVS, so that they can be
included in Python distributions for systems other than Windows.
Windows installers can be build on non-Windows systems as long as they
only include pure python module distributions.
Thomas Heller [Fri, 20 Feb 2004 18:05:13 +0000 (18:05 +0000)]
To avoid problems with conflicting dlls, the windows installers built
by bdist_wininst *must* use the same runtime libary as the Python
version.
Actually this means the Python version where the installer is run, not
the one which is used to build it. Must think about that - for now I
assume MSVC6 is used up to Python 2.3, and MSVC7.1 is used starting at
Python 2.4.
So the filename for wininst.exe is now wininst-6.exe for the Release
version and wininst-6_d.exe for the Debug version, when built with
MSVC6.
Thomas Heller [Fri, 20 Feb 2004 14:44:32 +0000 (14:44 +0000)]
Recompiled the binary wininst.exe.
Patch #892660 from Mark Hammond, for distutils bdist_wininst command.
install.c: support for a 'pre-install-script', run before anything has
been installed. Provides a 'message_box' module function for use by
either the pre-install or post-install scripts.
bdist_wininst.py: support for pre-install script. Typo (build->built),
fixes so that --target-version can still work, even when the
distribution has extension modules - in this case, we insist on
--skip-build, as we still can't actually build other versions.
Thomas Heller [Fri, 20 Feb 2004 14:43:21 +0000 (14:43 +0000)]
Patch #892660 from Mark Hammond, for distutils bdist_wininst command.
install.c: support for a 'pre-install-script', run before anything has
been installed. Provides a 'message_box' module function for use by
either the pre-install or post-install scripts.
bdist_wininst.py: support for pre-install script. Typo (build->built),
fixes so that --target-version can still work, even when the
distribution has extension modules - in this case, we insist on
--skip-build, as we still can't actually build other versions.
Vinay Sajip [Fri, 20 Feb 2004 13:18:36 +0000 (13:18 +0000)]
Copyright year & version number/version date changes.
Exception traceback text is now cached.
Closing a handler now removes it from the internal _handlers list.
Handlers now chain to Handler.close() from their close() methods.
Exception info can be passed as a tuple in exc_info.
shutdown() is registered to be called at application exit.
Vinay Sajip [Fri, 20 Feb 2004 13:17:27 +0000 (13:17 +0000)]
Copyright year change.
Corrections to comments.
Tracebacks can now be sent via SocketHandler.
SocketHandler now uses exponential backoff strategy.
Handlers now chain to Handler.close() from their close() methods.
Fred Drake [Thu, 19 Feb 2004 23:17:46 +0000 (23:17 +0000)]
- "Mac OS" should always include the space
- comment out documentation for a non-existant feature (--spec-file)
that the comments indicate isn't clearly needed
- lots of minor markup adjustments to get a more consistent
presentation
Fred Drake [Thu, 19 Feb 2004 23:03:29 +0000 (23:03 +0000)]
- according to Apple's publication style guide, yes, "Mac people" use
the term Installer (always capitalized, however)
- generalize the text about the term "installer" in a fairly
reasonable way
Fred Drake [Thu, 19 Feb 2004 22:28:15 +0000 (22:28 +0000)]
use API documentation style for the descriptions of the additional
functions made available in the post-installation script run by the
Windows installer
Guido van Rossum [Thu, 19 Feb 2004 19:16:50 +0000 (19:16 +0000)]
Fix two small bugs: (1) on Windows, pathname munging didn't work
right; (2) write_results_file() didn't return a tuple of two ints when
it couldn't create the file. Will backport.
Keep the list.pop() optimization while restoring the many possibility
for types other than PyInt being accepted for the optional argument.
(Spotted by Neal Norwitz.)
David Ascher [Wed, 18 Feb 2004 05:59:53 +0000 (05:59 +0000)]
Implementation of patch 869468
Allow the user to create Tkinter.Tcl objects which are
just like Tkinter.Tk objects except that they do not
initialize Tk. This is useful in circumstances where the
script is being run on machines that do not have an X
server running -- in those cases, Tk initialization fails,
even if no window is ever created.
Fred Drake [Tue, 17 Feb 2004 22:35:19 +0000 (22:35 +0000)]
commentary about how bad ConfigParser is doesn't help here, and the
suggested approach to dealing with it isn't a good one; we need a
better general purpose config reader, not a distutils-specific reader
* Moved the responsibility for emptying the previous list from list_fill
to list_init.
* Replaced the code in list_extend with the superior code from list_fill.
* Eliminated list_fill.
Results:
* list.extend() no longer creates an intermediate tuple except to handle
the special case of x.extend(x). The saves memory and time.
* list.extend(x) runs
about the same x is a list or tuple,
a little faster when x is an iterable not defining __len__, and
twice as fast when x is an iterable defining __len__.
* the code is about 15 lines shorter and no longer duplicates
functionality.
Refactor list_extend() and list_fill() for gains in code size, memory
utilization, and speed:
* Moved the responsibility for emptying the previous list from list_fill
to list_init.
* Replaced the code in list_extend with the superior code from list_fill.
* Eliminated list_fill.
Results:
* list.extend() no longer creates an intermediate tuple except to handle
the special case of x.extend(x). The saves memory and time.
* list.extend(x) runs
5 to 10% faster when x is a list or tuple
15% faster when x is an iterable not defining __len__
twice as fast when x is an iterable defining __len__
* the code is about 15 lines shorter and no longer duplicates
functionality.
Fine tune the speed/space trade-off for overallocating small lists.
The Py2.3 approach overallocated small lists by up to 8 elements.
The last checkin would limited this to one but slowed down (by 20 to 30%)
the creation of small lists between 3 to 8 elements.
This tune-up balances the two, limiting overallocation to 3 elements
(significantly reducing space consumption from Py2.3) and running faster
than the previous checkin.
The first part of the growth pattern (0, 4, 8, 16) neatly meshes with
allocators that trigger data movement only when crossing a power of two
boundary. Also, then even numbers mesh well with common data alignments.
Fred Drake [Fri, 13 Feb 2004 19:21:57 +0000 (19:21 +0000)]
further testing indicates that the simplified version of the test
(re-using an existing test object class) no longer triggered the
original segfault when the fix was backed out; restoring the local
test object class to make the test effective
the assignment of the ref created at the end does not affect the test,
since the segfault happended before weakref.ref() returned; removing
the assignment
* Optimized list appends and pops by making fewer calls the underlying system
realloc(). This is achieved by tracking the overallocation size in a new
field and using that information to skip calls to realloc() whenever
possible.
* Simplified and tightened the amount of overallocation. For larger lists,
this overallocates by 1/8th (compared to the previous scheme which ranged
between 1/4th to 1/32nd over-allocation). For smaller lists (n<6), the
maximum overallocation is one byte (formerly it could be upto eight bytes).
This saves memory in applications with large numbers of small lists.
* Eliminated the NRESIZE macro in favor of a new, static list_resize function
that encapsulates the resizing logic. Coverting this back to macro would
give a small (under 1%) speed-up. This was too small to warrant the loss
of readability, maintainability, and de-coupling.
* Some functions using NRESIZE had grown unnecessarily complex in their
efforts to bend to the macro's calling pattern. With the new list_resize
function in place, those other functions could be simplified. That is
being saved for a separate patch.
* The ob_item==NULL check could be eliminated from the new list_resize
function. This would entail finding each piece of code that sets ob_item
to NULL and adding a new line to invalidate the overallocation tracking
field. Rather than impose a new requirement on other pieces of list code,
it was preferred to leave the NULL check in place and retain the benefits
of decoupling, maintainability and information hiding (only PyList_New()
and list_sort() need to know about the new field). This approach also
reduces the odds of breaking an extension module.
(Collaborative effort by Raymond Hettinger, Hye-Shik Chang, Tim Peters,
and Armin Rigo.)
SF patch #884022: dynamic execution profiling vs opcode prediction
(Contributed by Andrew I MacIntyre.)
disables opcode prediction when dynamic execution
profiling is in effect, so the profiling counters at
the top of the main interpreter loop in eval_frame()
are updated for each opcode.
Jim Fulton [Sun, 8 Feb 2004 04:21:26 +0000 (04:21 +0000)]
Fixed a bug in object.__reduce_ex__ (reduce_2) when using protocol
2. Failure to clear the error when attempts to get the __getstate__
attribute fail caused intermittent errors and odd behavior.