Gregory P. Smith [Sun, 27 Jun 2004 23:32:34 +0000 (23:32 +0000)]
SF patch / bug #967763
Fix memory leaks revealed by valgrind and ensuing code inspection.
In the existing test suite valgrind revealed two memory leaks (DB_get
and DBC_set_range). Code inspection revealed that there were many other
potential similar leaks (many on odd code error paths such as passing
something other than a DBTxn object for a txn= parameter or in the face
of an out of memory error). The most common case that would cause a
leak was when using recno or queue format databases with integer keys,
sometimes only with an exception exit.
Brett Cannon [Sun, 27 Jun 2004 23:17:35 +0000 (23:17 +0000)]
Add code for a range function that uses generators.
Cleaned up existing code by abstracting code to parse arguments. Also removed
any unneeded operations (such as calling 'int' on a division when using floor
division also works). Fixed a bug where the values returned by
OldStyleRange could be short by one value. Added more documentation.
Gregory P. Smith [Sun, 27 Jun 2004 22:56:42 +0000 (22:56 +0000)]
Fix SF bug # 897820 - we can no longer use the DB_TRUNCATE flag when
opening the DB to implement legacy interface flag='n' support as
BerkeleyDB 4.2.52 no longer allows it in transaction protected
environments. Do the os.unlink ourselves.
* Silence a test failure that resulted when test_site was run by
regrtest.py after it ran test_frozen. This test was really only
designed to be run immediately after startup. Afterwards, other
modules could be loaded when had not been fixed-up by site.py
Took the chicken way out and only tested those modules known to
be imported by site.py.
Brett Cannon [Sat, 26 Jun 2004 23:10:32 +0000 (23:10 +0000)]
Clarify sentence at end of Intermezzo section stating that PyMODINIT_FUNC will
be discussed later by saying it is the function return type of the sample code
to make spotting it easier.
Brett Cannon [Sat, 26 Jun 2004 04:03:06 +0000 (04:03 +0000)]
Modules/getpath.c now compiles properly under OS X when using the
--disable-framework build; header file was protected in an #if using the wrong
macro to check.
Fred Drake [Thu, 24 Jun 2004 06:03:59 +0000 (06:03 +0000)]
move the note about the bsddb185 module above the "See also" box; that
should always go last in the relevant section's main content, but
before child sections
Tim Peters [Sun, 20 Jun 2004 22:41:32 +0000 (22:41 +0000)]
SF patch 876130: add C API to datetime module, from Anthony Tuininga.
The LaTeX is untested (well, so is the new API, for that matter).
Note that I also changed NULL to get spelled consistently in concrete.tex.
If that was a wrong thing to do, Fred should yell at me.
Tim Peters [Sun, 20 Jun 2004 02:50:16 +0000 (02:50 +0000)]
Bug 975996: Add _PyTime_DoubleToTimet to C API
New include file timefuncs.h exports private API function
_PyTime_DoubleToTimet() from timemodule.c. timemodule should export
some other functions too (look for painful bits in datetimemodule.c).
Added insane-argument checking to datetime's assorted fromtimestamp()
and utcfromtimestamp() methods. Added insane-argument tests of these
to test_datetime, and insane-argument tests for ctime(), localtime()
and gmtime() to test_time.
Brett Cannon [Sat, 19 Jun 2004 20:48:43 +0000 (20:48 +0000)]
Raise ValueError when value being stored in a time_t variable will result in
more than a second of precision. Primarily affects ctime, localtime, and
gmtime.
Closes bug #919012 thanks to Tim Peters' code.
Tim suggests that the new funciton being introduced, _PyTime_DoubletoTimet(),
should be added to the internal C API and then used in datetime where
appropriate. Not being done now for lack of time.
Thomas Heller [Fri, 18 Jun 2004 17:03:38 +0000 (17:03 +0000)]
When loading the Python dll to run the postinstall script, try to load
it from the install directory (as reported by the registry) in case it
is not found on the default Loadlibrary search path.
Fixes SF 935091: bdist_winist post-install script fails on non-admin Python
Neal Norwitz [Sun, 13 Jun 2004 20:45:11 +0000 (20:45 +0000)]
SF patch #969180, hotshot incorrectly computes elapsed time by Jason
Beardsley.
If the seconds are different, we still need to calculate the differences
between milliseconds.
Also, on a Gentoo Linux (2.6.5) dual Athlon MP box with glibc 2.3,
time can go backwards. This probably happens when the process switches
the CPU it's running on. Time can also go backwards when running NTP.
If we detect a negative time delta (ie, time went backwards), return
a delta of 0. This prevents an illegal array access elsewhere.
I think it's safest to *not* update prev_timeofday in this case, so we
return without updating.
Improve the memory performance and speed of heapq.nsmallest() by using
an alternate algorithm when the number of selected items is small
relative to the full iterable.
Fred Drake [Fri, 11 Jun 2004 21:50:33 +0000 (21:50 +0000)]
Add support for package data.
This is basically the support for package data from Phillip Eby's
setuptools package. I've changed it only to fit it into the core
implementation rather than to live in subclasses, and added
documentation.
lightly modified version of my patch
[ 971323 ] make test_signal less annoying
after some comments on IRC from a highly opinionated australian who
wishes to remain anonymous.