* 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.
Futher improvements to frozenset hashing (based on Yitz Gale's battery of
tests which nicely highly highlight weaknesses).
* Initial value is now a large prime.
* Pre-multiply by the set length to add one more basis of differentiation.
* Work a bit harder inside the loop to scatter bits from sources that
may have closely spaced hash values.
All of this is necessary to make up for keep the hash function commutative.
Fortunately, the hash value is cached so the call to frozenset_hash() will
only occur once per set.
* Non-zero initial value so that hash(frozenset()) != hash(0).
* Final permutation to differentiate nested sets.
* Add logic to make sure that -1 is not a possible hash value.