Tim Peters [Tue, 11 Apr 2006 00:43:27 +0000 (00:43 +0000)]
Try to repair more new buildbot failures in "x86 OpenBSD trunk", due
to that id() can now return a Python long on a 32-bit box that allocates
addresses "with the sign bit set".
test_set.py test_subclass_with_custom_hash(): it's never been portably
legal for a __hash__() method to return id(self), but on 32-bit boxes
that never caused a problem before it became possible for id() to
return a Python long. Changed __hash__ here to return a Python int
regardless of platform.
test_descr.py specials():
vereq(hash(c1), id(c1))
has never been a correct test -- just removed it (hash() is always
a Python int; id() may be a Python long).
Tim Peters [Mon, 10 Apr 2006 21:38:11 +0000 (21:38 +0000)]
Fix one of the tests that fails on the "x86 OpenBSD trunk" buildbot,
due to that id() may return a long on a 32-bit box now. On a box that
assigns addresses "with the sign bit set", id() always returns a long now.
Tim Peters [Mon, 10 Apr 2006 21:34:00 +0000 (21:34 +0000)]
Fix one of the tests that fails on the "x86 OpenBSD trunk" buildbot, due
to that id() may return a long on a 32-bit box now. On a box that assigns
addresses "with the sign bit set", id() always returns a long now.
Tim Peters [Mon, 10 Apr 2006 20:25:47 +0000 (20:25 +0000)]
DecimalContextTestCase: this permanently changed the
default decimal context, causing test_tokenize to fail
if it ran after test_contextlib. Changed to restore
the decimal context in effect at the test's start.
SF Patch #1463867: Improved generator finalization to allow generators
that are suspended outside of any try/except/finally blocks to be
garbage collected even if they are part of a cycle. Generators that
suspend inside of an active try/except or try/finally block (including
those created by a ``with`` statement) are still not GC-able if they
are part of a cycle, however.
Martin v. Löwis [Mon, 10 Apr 2006 15:55:37 +0000 (15:55 +0000)]
Patch #1467770: Add Popen objects to _active only in __del__.
Introduce _child_active member to keep track on whether a child
needs to be waited for.
Backport candidate.
SF patch #1467512, fix double free with triple quoted string in standard build.
This was the result of inconsistent use of PyMem_* and PyObject_* allocators.
By changing to use PyObject_* allocator almost everywhere, this removes
the inconsistency.
Anthony Baxter [Sun, 9 Apr 2006 15:07:40 +0000 (15:07 +0000)]
Python on OS X 10.3 and above now uses dlopen() (via dynload_shlib.c)
to load extension modules and now provides the dl module. As a result,
sys.setdlopenflags() now works correctly on these systems. (SF patch
#1454844)
Tim Peters [Sat, 8 Apr 2006 12:05:15 +0000 (12:05 +0000)]
test_timeout(): This test was added during Bug Day, but disabled
soon after because the gmail address it connects to started timing
out on all the buildbot slaves. Rewrote the test to produce a
warning message (instead of failing) when the address times out.
Also removed the special case for Windows -- this test started to
work on Windows as soon as bug 1462352 was fixed.
Thomas Heller [Thu, 6 Apr 2006 15:23:16 +0000 (15:23 +0000)]
Expose RTLD_LOCAL and RTLD_GLOBAL always from the _ctypes extension module.
If RTLD_LOCAL is not #defined in any header file (Windows), set it to 0.
If RTLD_GLOBAL is not #defined, set it equal to RTLD_LOCAL.
Anthony Baxter [Thu, 6 Apr 2006 07:12:39 +0000 (07:12 +0000)]
In some environments (under screen, in a chroot) curses doesn't support
mouse events. This makes the test fail. Catch that case and don't run
the tests. Should make the debian/ubuntu buildbots that run in a chroot
work again.
Tim Peters [Tue, 4 Apr 2006 19:12:51 +0000 (19:12 +0000)]
The part checking for the sqlite DLL was looking at, and
copying to, a wrong location (it copied the DLL under the
Python directory, and gave it name 'PCbuild').
The Windows buildbots other than mine are probably hung
now, waiting for someone to press "OK" on a popup box
informing them that sqlite3.dll couldn't be found.
Walter Dörwald [Tue, 4 Apr 2006 17:32:49 +0000 (17:32 +0000)]
Change the example classes UnicodeReader and UnicodeWriter so
that they work with all encodings. For UnicodeReader the real
input stream is wrapped in a line iterator that reencodes the
input to UTF-8. For UnicodeWriter the UTF-8 encoded output is
written to a queue for where it is reencoded to the target
encoding and written to the real output stream.
Thomas Wouters [Tue, 4 Apr 2006 17:28:12 +0000 (17:28 +0000)]
Make xrange more Py_ssize_t aware, by assuming a Py_ssize_t is always at
least as big as a long. I believe this to be a safe assumption that is being
made in many parts of CPython, but a check could be added.
len(xrange(sys.maxint)) works now, so fix the testsuite's odd exception for
64-bit platforms too. It also fixes 'zip(xrange(sys.maxint), it)' as a
portable-ish (if expensive) alternative to enumerate(it); since zip() now
calls len(), this was breaking on (real) 64-bit platforms. No additional
test was added for that behaviour.
Anthony Baxter [Tue, 4 Apr 2006 15:52:00 +0000 (15:52 +0000)]
Fix test_platform on cygwin. When running from build area, sys.executable
is 'python'. But 'python' is actually a directory, 'python.exe' is the
executable.
Jeremy Hylton [Tue, 4 Apr 2006 14:26:39 +0000 (14:26 +0000)]
Generate line number table entries for except handlers.
Re-enable all the tests in test_trace.py except one. Still not sure that these tests test what they used to test, but they pass. One failing test seems to be caused by undocumented line number table behavior in Python 2.4.