Yury Selivanov [Thu, 17 Dec 2015 00:31:17 +0000 (19:31 -0500)]
asyncio: Skip getaddrinfo if host is already resolved.
getaddrinfo takes an exclusive lock on some platforms, causing clients to queue
up waiting for the lock if many names are being resolved concurrently. Users
may want to handle name resolution in their own code, for the sake of caching,
using an alternate resolver, or to measure DNS duration separately from
connection duration. Skip getaddrinfo if the "host" passed into
create_connection is already resolved.
See https://github.com/python/asyncio/pull/302 for details.
Martin Panter [Wed, 16 Dec 2015 04:36:20 +0000 (04:36 +0000)]
Issue #23788: Merge redundant test_bad_address() into test_urllibnet
In Python 2, these were duplicated; one for urllib.urlopen() and one for
urllib2.urlopen(). The test_urllibnet version has a better precondition to
avoid false failures with bad DNS, and the test_urllib2_localnet version had
a more up-to-date comment and domain name.
Gregory P. Smith [Mon, 14 Dec 2015 06:10:28 +0000 (22:10 -0800)]
Issue #11072: change the incorrect "deprecation" of ftplib dir() and nlst()
APIs into a note that mlsd() is a nicer API if the server supports
it. They aren't deprecated, they are all different server commands.
Not all servers support all commands.
Gregory P. Smith [Mon, 14 Dec 2015 04:09:42 +0000 (20:09 -0800)]
* Re-fix issue #19284: Don't generate the no-op -R command line
parameter to "enable" the always on sys.flags.hash_randomization
in _args_from_interpreter_flags() used by multiprocessing and
some unittests. This simplifies the code.
* assert_python_ok docstring typo fix.
* Fix test_cmd_line not to fail if PYTHONHASHSEED is set to a fixed seed.
Gregory P. Smith [Mon, 14 Dec 2015 04:05:55 +0000 (20:05 -0800)]
Re-fix issue #19284: Don't generate the no-op -R command line
parameter to "enable" the always on sys.flags.hash_randomization
in _args_from_interpreter_flags() used by multiprocessing and
some unittests. This simplifies the code.
Martin Panter [Tue, 8 Dec 2015 00:03:20 +0000 (00:03 +0000)]
Issue #25701: Document C API functions that both set and delete objects
Also document that the separate functions that delete objects are preferred;
using PyObject_SetAttr(), _SetAttrString(), and PySequence_SetItem() to
delete is deprecated.
Martin Panter [Sun, 6 Dec 2015 03:15:05 +0000 (03:15 +0000)]
Issue #25717: Tolerate fstat() failures in the FileIO constructor
This restores 3.4 behaviour, which was removed by revision 3b5279b5bfd1. The
fstat() call fails with ENOENT for a Virtual Box shared folder filesystem if
the file entry has been unlinked, e.g. for a temporary file.
Martin Panter [Sat, 5 Dec 2015 09:51:52 +0000 (09:51 +0000)]
Issue #25764: Skip the test on OS X
The OS X buildbots were failing at the second setrlimit() call with EPERM, as
if they were trying to raise the hard limit. The call should be keeping the
hard limit the same and raising the soft limit back to its original value, so
I don't understand the failure.
R David Murray [Sat, 5 Dec 2015 03:54:38 +0000 (22:54 -0500)]
#24903: Remove misleading error message to fix regression.
Before the argparse conversion, compileall would (sometimes) accept multiple
paths when -d was specified. Afterward, it does not. The corresponding check
in the original code claimed to prevent multiple *directories* from being
specified...but it didn't really work even to do that. So this patch fixes
the regression by invoking the consenting adults rule: if you specify a
combination of arguments to compileall that produces files with inconsistent
destdirs (which you could do before), it is on you.
Martin Panter [Thu, 3 Dec 2015 01:23:10 +0000 (01:23 +0000)]
Issue #14285: Do not catch __init__.py exceptions in runpy
Initialize package before calling find_spec() for __main__, so that we do not
incorrectly handle exceptions from __init__.py. When runpy is used from the
Python CLI, use an internal exception rather than ImportError, to avoid
catching unexpected exceptions.
Also remove exception message rewriting in _run_module_as_main(), because it
seems to be redundant with the _get_main_module_details() function.