Brett Cannon [Tue, 4 May 2010 00:52:41 +0000 (00:52 +0000)]
Strip out extraneous whitespace, cast a some `const char *` to `void *` when
passed to free() and make a `char *` to a `const char *` as found by Clang's
static analyzer.
Antoine Pitrou [Mon, 3 May 2010 16:25:33 +0000 (16:25 +0000)]
Issue #7865: The close() method of :mod:`io` objects should not swallow
exceptions raised by the implicit flush(). Also ensure that calling
close() several times is supported. Patch by Pascal Chambon.
Only override the AC_PROG_CC determined CFLAGS if they were set by the user.
This restores the default behavior in the common case of not having CFLAGS
defined when running configure.
Ronald Oussoren [Fri, 30 Apr 2010 11:20:14 +0000 (11:20 +0000)]
Fix for issue #3646: with this patch it is possible to do a
framework install of Python in your home directory (on OSX):
$ configure --enable-framework=${HOME}/Library/Frameworks
$ make && make install
Without this patch the framework would get installed just fine,
but 'make install' would try to install the application bundles
and command-line tools outside the user's home, which doesn't work
for non-admin users (and is bad form anyway).
Fix doubled 'the'.
Markup fixes to use :exc:, :option: in a few places.
(Glitch: unittest.main's -c ends up a link to the Python
interpreter's -c option. Should we skip using :option: for that
switch, or disable the auto-linking somehow?)
Victor Stinner [Tue, 27 Apr 2010 23:55:59 +0000 (23:55 +0000)]
Issue #7449, last part (11): fix many tests if thread support is disabled
* Use try/except ImportError or test_support.import_module() to import thread
and threading modules
* Add @unittest.skipUnless(threading, ...) to testcases using threads
Victor Stinner [Tue, 27 Apr 2010 23:51:16 +0000 (23:51 +0000)]
Issue #7449, part 10: test_cmd imports trace module using test_support.import_module()
Use test_support.import_module() instead of import to raise a SkipTest
exception if the import fail. Import trace fails if the threading module is
missing.
See also part 3: test_doctest: import trace module in test_coverage().
Victor Stinner [Tue, 27 Apr 2010 23:33:58 +0000 (23:33 +0000)]
Partial revert of r80556 (Issue #7449, part 5, fix ctypes test)
Rewrite r80556: the thread test have to be executed just after the test on
libc_open() and so the test cannot be splitted in two functions (without
duplicating code, and I don't want to duplicate code).
Victor Stinner [Tue, 27 Apr 2010 23:14:58 +0000 (23:14 +0000)]
Issue #7449, part 9: fix test_xmlrpclib for missing threading module
* Skip testcases using threads if threading module is missing
* Use "http://" instead of URL in ServerProxyTestCase if threading is missing
because URL is not set in this case
Victor Stinner [Tue, 27 Apr 2010 23:01:29 +0000 (23:01 +0000)]
Issue #7449, part 7: simplify threading detection in test_capi
* Skip TestPendingCalls if threading module is missing
* Test if threading module is present or not, instead of test the presence of
_testcapi._test_thread_state
Victor Stinner [Tue, 27 Apr 2010 22:01:24 +0000 (22:01 +0000)]
Issue #7449, part 5: split Test.test_open() of ctypes/test/test_errno.py
* Split Test.test_open() in 2 functions: test_open() and test_thread_open()
* Skip test_open() and test_thread_open() if we are unable to find the C
library
* Skip test_thread_open() if thread support is disabled
* Use unittest.skipUnless(os.name == "nt", ...) on test_GetLastError()
Victor Stinner [Tue, 27 Apr 2010 21:56:26 +0000 (21:56 +0000)]
Issue #7449, part 4: skip test_multiprocessing if thread support is disabled
import threading after _multiprocessing to raise a more revelant error message:
"No module named _multiprocessing". _multiprocessing is not compiled without
thread support.
Victor Stinner [Tue, 27 Apr 2010 21:51:26 +0000 (21:51 +0000)]
Issue #7449 part 3, test_doctest: import trace module in test_coverage()
Import trace module fail if the threading module is missing. test_coverage() is
only used if test_doctest.py is used with the -c option. This commit allows to
execute the test suite without thread support.
Move "import trace" in test_coverage() and use
test_support.import_module('trace').
Antoine Pitrou [Tue, 27 Apr 2010 09:51:18 +0000 (09:51 +0000)]
replace custom code with standard library functionality (HTTPServer.shutdown())
+ enable test that was never run (!)
+ make tests faster by lowering polling timeout
R. David Murray [Mon, 26 Apr 2010 21:17:14 +0000 (21:17 +0000)]
Issue #6656: fix locale.format_string to handle escaped percents and mappings.
Refactors format_string. Includes tests for the two problems noted in
the issue, but as far as I can see there are no other tests that confirm
that format_string conforms to normal % formatting rules.
When DeprecationWarning was silenced by default, it also silenced any use of -Q
by default as well. This change fixes that by treating -Q like -3 when it comes
to DeprecationWarning; using it causes the silencing to not occur.
Antoine Pitrou [Sun, 25 Apr 2010 21:40:32 +0000 (21:40 +0000)]
Issue #2302: Fix a race condition in SocketServer.BaseServer.shutdown,
where the method could block indefinitely if called just before the
event loop started running. This also fixes the occasional freezes
witnessed in test_httpservers.