Thomas Wouters [Tue, 25 Apr 2006 15:33:48 +0000 (15:33 +0000)]
Backport trunk's r45715:
Define MAXPATHLEN to be at least PATH_MAX, if that's defined. Python uses
MAXPATHLEN-sized buffers for various output-buffers (like to realpath()),
and that's correct on BSD platforms, but not Linux (which uses PATH_MAX, and
does not define MAXPATHLEN.) Cursory googling suggests Linux is following a
newer standard than BSD, but in cases like this, who knows. Using the
greater of PATH_MAX and 1024 as a fallback for MAXPATHLEN seems to be the
most portable solution.
Put break at correct level so *all* root HKEYs acutally get checked for
an installed VC6. Otherwise only the first such tree gets checked and this
warning doesn't get displayed.
Python 2.4 changed ntpath.abspath to do an import
inside the function. As a result, due to Python's
import lock, anything calling abspath on Windows
(directly, or indirectly like tempfile.TemporaryFile)
hung when it was called from a thread spawned as a
side effect of importing a module.
This is a depressingly frequent problem, and
deserves a more general fix. I'm settling for
a micro-fix here because this specific one accounts
for a report of Zope Corp's ZEO hanging on Windows,
and it was an odd way to change abspath to begin
with (ntpath needs a different implementation
depending on whether we're actually running on
Windows, and the _obvious_ way to arrange for that
is not to bury a possibly-failing import _inside_
the function).
Note that if/when other micro-fixes of this kind
get made, the new Lib/test/threaded_import_hangers.py
is a convenient place to add tests for them.
Tim Peters [Tue, 18 Apr 2006 03:30:43 +0000 (03:30 +0000)]
Merge rev 45516 from trunk.
Finally figured out why this module did its imports at the
bottom of the file. Restored that, and added a comment
explaining why this is necessary. Hint: on my box, and
yours, it's not :-(
Tim Peters [Mon, 17 Apr 2006 21:15:53 +0000 (21:15 +0000)]
Merge rev 45498 from trunk.
local.__del__(): This didn't actually do anything, because of too
much convolution <0.5 wink>. Simplified to the point that it works,
and test_threading_local no longer reports leaks under -R. Thanks
to Thomas Wouters for initial analysis.
Backport 45338:
test_compile can be really long if we are using -u compiler.
This may be causing the debian sparc buildbot to fail.
Print a little message to let the user ^w buildbot know it's still thinking.
We may want to adjust the time period which is currently 5 minutes.
Anthony Baxter [Thu, 13 Apr 2006 01:29:10 +0000 (01:29 +0000)]
reverting r45322 - "traceback.format_exception_only() now prepends
the exception's module name to non-builtin exceptions, like the
interpreter itself does."
Reverting because:
A - broke tests
B - changed behaviour of 2.4.
Georg Brandl [Wed, 12 Apr 2006 21:14:12 +0000 (21:14 +0000)]
Patch #860326: traceback.format_exception_only() now prepends the
exception's module name to non-builtin exceptions, like the interpreter
itself does.
(backport from rev. 45321)
Tim Peters [Sat, 8 Apr 2006 12:12:56 +0000 (12:12 +0000)]
Merge rev 43734 from the trunk.
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.
Anthony Baxter [Thu, 6 Apr 2006 07:15:06 +0000 (07:15 +0000)]
backport:
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 [Mon, 3 Apr 2006 23:44:28 +0000 (23:44 +0000)]
Rev 43597 on the branch purported to merge rev 43578 from the trunk,
but neglected to incorporate 43578's changes to
Lib/email/test/test_email.py. As a result, all the buildbots have
failed test_email on the branch since then. This should repair it.
Anthony Baxter [Mon, 3 Apr 2006 16:40:28 +0000 (16:40 +0000)]
backport of r43578
The email module's parsedate_tz function now sets the daylight savings
flag to -1 (unknown) since it can't tell from the date whether it should
be set.
patch from Aldo Cortesi
Fix test_pty on OSF/1 (Tru64). The problem is that the newline gets
converted to CR CR NL. There may be a way to fix this with tcsetattr,
but I couldn't find it. There was a similar problem on IRIX.
Backport 43470:
Get gcc to do strict IEEE math. This flag was already used for cc, just not
gcc. Without this flag, doing pretty much anything with NaNs causes
a Floating Point Exception signal. This causes the interpreter to quit.
The failing tests this fixes are: test_long.
This is somewhat equivalent to doing signal(SIGFPE, SIG_IGN).
Georg Brandl [Fri, 31 Mar 2006 20:00:15 +0000 (20:00 +0000)]
bug #1461855: make os.fdopen() add the O_APPEND flag if using "a" mode.
glibc, for example, does this already on its own, but it seems that
the solaris libc doesn't. This leads to Python code being able to over-
write file contents even though having specified "a" mode.
(backport from rev. 43501)
Hye-Shik Chang [Tue, 28 Mar 2006 08:27:27 +0000 (08:27 +0000)]
Ubuntu bug #29289: Fixed a bug that the gb18030 codec raises
RuntimeError on encoding surrogate pair area on UCS4 build.
This is a partial backport of r43320. (Approved by Anthony Baxter)
Tim Peters [Tue, 28 Mar 2006 07:09:33 +0000 (07:09 +0000)]
Merge rev 43181 from the trunk.
Try to repair at least one segfault on the Mac buildbot,
as diagnosed by Nick Coghlan.
test_capi.py: A test module should never spawn a thread as
a side effect of being imported. Because this one did, the
segfault one of its thread tests caused didn't occur until
a few tests after test_regrtest.py thought test_capi was
finished. Repair that. Also join() the thread spawned
at the end, so that test_capi is truly finished when
regrtest reports that it's done.
_testcapimodule.c test_thread_state(): this spawns a
couple of non-threading.py threads, passing them a PyObject*
argument, but did nothing to ensure that those threads
finished before returning. As a result, the PyObject*
_could_ (although this was unlikely) get decref'ed out of
existence before the threads got around to using it.
Added explicit synchronization (via a Python mutex) so
that test_thread_state can reliably wait for its spawned
threads to finish.
Neal Norwitz [Tue, 28 Mar 2006 06:05:21 +0000 (06:05 +0000)]
Fix the refleak from test_unicode.
Backport 42973 (lots of whitespace changes intermixed):
- Reindent a confusingly indented piece of code (no intended code changes
there)
- Add missing DECREFs of inner-scope 'temp' variable
- Add various missing DECREFs by changing 'return NULL' into 'goto onError'
- Avoid double DECREF when last _PyUnicode_Resize() fails
Coverity found one of the missing DECREFs, but oddly enough not the others.
Martin v. Löwis [Mon, 27 Mar 2006 21:38:32 +0000 (21:38 +0000)]
Backport of r41530 (neal.norwitz, 2005-11-24):
Move registration of the codec search function to the module scope
so it is only executed once. Otherwise the same search function is
repeated added to the codec search path when regrtest is run with -R
and leaks are reported.
Thomas Wouters [Mon, 27 Mar 2006 12:50:42 +0000 (12:50 +0000)]
Backport Ka-Ping Yee's trunk checkin r41400:
Fix SF bug #417833 (pydoc HTTP reload failure) by removing from
sys.modules all submodules of a the given module/package path
when trying to reload a module.
Neal Norwitz [Sun, 26 Mar 2006 04:10:42 +0000 (04:10 +0000)]
Backport:
Handle sys.getfilesystemencoding() returning None.
ascii seems like the safest bet, it should exist. I wonder if utf-8
would be a better choice? This should get test_fileinput passing on OpenBSD.