Commit graph

9148 commits

Author SHA1 Message Date
Brett Cannon
cc4e935ea5 threading.Thread objects will now print a traceback for an exception raised
during interpreter shutdown instead of masking it with another traceback about
accessing a NoneType when trying to print the exception out in the first place.

Closes bug #754449 (using patch #954922).
2004-07-03 03:52:35 +00:00
Walter Dörwald
59ad45689b Add tests that check the result of calendar.monthcalendar() for a set
of corner cases.
2004-07-02 19:00:09 +00:00
Fred Drake
0a4dd390bf Make weak references subclassable:
- weakref.ref and weakref.ReferenceType will become aliases for each
  other

- weakref.ref will be a modern, new-style class with proper __new__
  and __init__ methods

- weakref.WeakValueDictionary will have a lighter memory footprint,
  using a new weakref.ref subclass to associate the key with the
  value, allowing us to have only a single object of overhead for each
  dictionary entry (currently, there are 3 objects of overhead per
  entry: a weakref to the value, a weakref to the dictionary, and a
  function object used as a weakref callback; the weakref to the
  dictionary could be avoided without this change)

- a new macro, PyWeakref_CheckRefExact(), will be added

- PyWeakref_CheckRef() will check for subclasses of weakref.ref

This closes SF patch #983019.
2004-07-02 18:57:45 +00:00
Thomas Heller
32b8f8052a Fix for SF 982215: bdist_wininst - Next button not greyed out during file copy.
Patch from Mark Hammond.
Recompiled binary.

Already packported to the 2.3 branch.
2004-07-02 08:02:40 +00:00
Raymond Hettinger
214b1c3aae SF Bug #215126: Over restricted type checking on eval() function
The builtin eval() function now accepts any mapping for the locals argument.
Time sensitive steps guarded by PyDict_CheckExact() to keep from slowing
down the normal case.  My timings so no measurable impact.
2004-07-02 06:41:07 +00:00
Fred Drake
83a6430717 Committing Tim's patch for SF bug #983585:
test_repr() fails with id() values that appear negative
2004-07-01 20:28:47 +00:00
Michael W. Hudson
d7cc1bd809 Fix
[ 924301 ] A leak case with cmd.py & readline & exception

by ensuring that the readline completion function is always reset
even in the case of an exception being raised.  As a bonus, this
makes the documentation for pre & postloop accurate again.
2004-07-01 14:52:10 +00:00
Fred Drake
1f34eb17b5 fix small consistency nit 2004-07-01 14:28:36 +00:00
Raymond Hettinger
75cc1cb7e0 Move Decimal from the sandbox into production. 2004-07-01 11:15:39 +00:00
Raymond Hettinger
7c85fa4a52 Move Decimal from the sandbox into production. 2004-07-01 11:01:35 +00:00
Michael W. Hudson
d5cf143482 Check in the updated version of patch #957240, which doesn't rely
on the marshalling characteristics of infinities.
2004-06-30 09:02:33 +00:00
Andrew M. Kuchling
08c08bb3d1 [Bug #912845] urllib2 only checks for a 200 return code, but 206 is also legal if a Range: header was supplied.
(Actually, should the first 'if' statement be modified to allow any 2xx status code?)
2004-06-29 13:19:19 +00:00
Andrew M. Kuchling
31352c5a30 Remove unused import. (If it's there for some deep, dark reason, it should have been commented.) 2004-06-29 13:17:29 +00:00
Andrew M. Kuchling
bd3200fa2b Add test case for bug #912845: requesting an HTTP byte range doesn't work 2004-06-29 13:15:46 +00:00
Andrew M. Kuchling
f1a2f9ec41 Docstring grammar fix 2004-06-29 13:07:53 +00:00
Brett Cannon
fbac294d59 rsync is now a recognized protocol that uses "netloc" (i.e. specifies a network
location) in its addressing.

Closes bug #981299.
2004-06-29 04:02:40 +00:00
Raymond Hettinger
3b04ce824d Patch from Mark Hammond to fix a test error.
Now runs without exception on WinME/98.
2004-06-28 06:57:19 +00:00
Gregory P. Smith
19699a9351 Adds support for DB.pget and DBCursor.pget methods.
Based on a patch supplied by Ian Ward <ian@arevco.ca> on the pybsddb
mailing list 2004-03-26.
2004-06-28 04:06:49 +00:00
Barry Warsaw
11b91a0ea3 Added socket.getservbyport(), and make its second argument and that of
getservbyname() optional.  Update the tests and the docs.
2004-06-28 00:50:43 +00:00
Gregory P. Smith
dc5af70631 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.
2004-06-27 23:32:34 +00:00
Gregory P. Smith
a6b3caad41 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.
2004-06-27 22:56:42 +00:00
Raymond Hettinger
ebd95222bf * 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.

* Normalized whitespace.
2004-06-27 03:02:18 +00:00
Skip Montanaro
5fad8bd088 remove debugging print 2004-06-26 19:42:10 +00:00
Skip Montanaro
90e0153940 Allow classes from other modules to be specified at startup. For example,
using the postfixproxy module from Spambayes you might start smtpd up like

    smtpd.py -c spambayes.postfixproxy.SpambayesProxy :8025 :8026
2004-06-26 19:18:49 +00:00
Nicholas Bastin
d858a7763a Massive performance improvement for C extension and builtin tracing code 2004-06-25 23:31:06 +00:00
Fred Drake
ec6229e352 Make distutils "install --home" support all platforms. 2004-06-25 23:02:59 +00:00
Fred Drake
22021579a9 add boilerplate so the test modules can be run as scripts 2004-06-25 19:04:21 +00:00
Raymond Hettinger
9c18e81fb2 Install two code generation optimizations that depend on NOP.
Reduces the cost of "not" to almost zero.
2004-06-21 16:31:15 +00:00
Fred Drake
2c9f889122 add a couple of tests for the build_scripts command 2004-06-21 16:15:22 +00:00
Martin v. Löwis
873a277eb4 Patch #975885: print file name in err msg in quiet mode 2004-06-20 20:59:56 +00:00
Raymond Hettinger
28224f897a Improve the documented advice on how to best use heapq.heapreplace(). 2004-06-20 09:07:53 +00:00
Tim Peters
1b6f7a9057 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.
2004-06-20 02:50:16 +00:00
Brett Cannon
1c3fa18be7 shutil.move() will raise an exception when trying to move a directory into
itself.

Closes bug #919012  .  Thanks Johannes Gijsbers.
2004-06-19 21:11:35 +00:00
Marc-André Lemburg
cdc7923f6d Added normalization for Windows system name. Closes SF #945665. 2004-06-19 17:17:00 +00:00
Brett Cannon
84601f14a3 Change pydoc.stripid() be able to match against 64-bit addresses by having
regex match from 6 to 16 characters.
2004-06-19 01:22:48 +00:00
Brett Cannon
c6c1f478d9 pydoc.stripid() is now case-insensitive for its regex to support platforms that
have pointer addresses in uppercase.

Closes bug #934282.  Thanks Robin Becker.
2004-06-19 01:02:51 +00:00
Fred Drake
2b2fe94cde fix typo 2004-06-18 21:28:28 +00:00
Sjoerd Mullender
4dbda47aea If self.packages is None (this can happen, I saw it), return
immediately (since None is not a sequence you can iterate over).
2004-06-18 20:39:11 +00:00
Thomas Heller
89a2dc72b1 Rebuild the wininst.exe files. 2004-06-18 18:30:27 +00:00
Fred Drake
b849eddde6 fix bug: list of data files was initialized too soon in build_py 2004-06-17 20:16:19 +00:00
Fred Drake
b8ab8b6da8 move support code to a helper module to ease re-use 2004-06-17 20:14:50 +00:00
Raymond Hettinger
aefde435ef Reverse argument order for nsmallest() and nlargest().
Reads better when the iterable is a generator expression.
2004-06-15 23:53:35 +00:00
Fred Drake
d0620dcf00 add a test that actually installs some scripts 2004-06-15 16:55:46 +00:00
Fred Drake
bb7c14461d One unit test for distutils is not much, but is more than we had yesterday.
We need to write more; hopefully the barrier is a little lower now.
2004-06-15 15:49:46 +00:00
Raymond Hettinger
a050171ee9 SF bug #973092: inspect.getframeinfo bug if 'context' is to big
Make sure the start argument is not negative.
2004-06-15 11:22:53 +00:00
Raymond Hettinger
b67ad7e671 Patch #826074: cmath.log optional base argument, fixes #823209
(Contributed by Andrew Gaul.)
2004-06-14 07:40:10 +00:00
Martin v. Löwis
ad21945d03 Back out #957240. 2004-06-14 04:58:42 +00:00
Raymond Hettinger
bb6b7346ce Apply heapq.nlargest() to find best matches. 2004-06-13 09:57:33 +00:00
Raymond Hettinger
59efe363b6 Add heapq to list of __all__ checks. 2004-06-13 05:46:14 +00:00
Raymond Hettinger
2e3dfaf707 Install C version of heapq.nsmallest(). 2004-06-13 05:26:33 +00:00