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.
Brian Curtin [Sat, 24 Apr 2010 15:40:11 +0000 (15:40 +0000)]
Fix #7838. Add docstrings and privatize _subprocess implementation details.
Since CREATE_NEW_* are used for the creation flags of a subprocess, they
were added to __all__. The rest of the previously exposed attributes are
now qualified by _subprocess.ATTR rather than importing *.
Antoine Pitrou [Sat, 24 Apr 2010 10:43:57 +0000 (10:43 +0000)]
Make test_makefile_close a networked test (can't read() from a non-connected
socket under OS X), and skip it under Windows (where sockets can't be read()
from using their fds).
Antoine Pitrou [Thu, 22 Apr 2010 23:33:02 +0000 (23:33 +0000)]
Issue #8108: Fix the unwrap() method of SSL objects when the socket has
a non-infinite timeout. Also make that method friendlier with applications
wanting to continue using the socket in clear-text mode, by disabling
OpenSSL's internal readahead. Thanks to Darryl Miles for guidance.
Issue #8108: test_ftplib's non-blocking SSL server now has proper handling
of SSL shutdowns.
Antoine Pitrou [Wed, 21 Apr 2010 22:53:29 +0000 (22:53 +0000)]
Issue #7332: Remove the 16KB stack-based buffer in
PyMarshal_ReadLastObjectFromFile, which doesn't bring any noticeable
benefit compared to the dynamic memory allocation fallback. Patch by
Charles-François Natali.
Antoine Pitrou [Wed, 21 Apr 2010 19:28:03 +0000 (19:28 +0000)]
Issue #8484: Load all ciphers and digest algorithms when initializing
the _ssl extension, such that verification of some SSL certificates
doesn't fail because of an "unknown algorithm".
Stefan Krah [Tue, 20 Apr 2010 07:59:10 +0000 (07:59 +0000)]
1) The timeout in the itimer tests was too low for slow or heavily
loaded machines.
2) Even with the increased timeout, the OS does not guarantee that
a process will get a certain amount of virtual time in 60s, so
the failure is changed to a diagnostic.
Victor Stinner [Sun, 18 Apr 2010 09:07:49 +0000 (09:07 +0000)]
platform: use subprocess.Popen() instead of os.popen() in _syscmd_file()
* Popen() avoids ugly shell escape: target.replace('"', '\\"')
* Use proc.communicate() instead of f.stdout.read()
* Get output from stdout by splitting with ": " instead of splitting by spaces
to support filename with spaces
R. David Murray [Sat, 17 Apr 2010 05:26:26 +0000 (05:26 +0000)]
Issue #3864: Skip three test_signal tests on freebsd6 due to platform bug.
Two itimer tests and an interprocess signal test fail on FreeBSD 6 if
any test that starts a thread runs before test_signal. Since FreeBSD7
does not show this behavior, the bug is most likely a platform bug,
so this patch just skips the failing tests on freebsd6.