Improve the description of the high and low parameters for set_write_buffer_limits.
Also fixed a small grammatical issue.
(cherry picked from commit 5200a7c7f9ea65a96330c5f276f4acc6ec70854e)
Victor Stinner [Fri, 30 Jun 2017 15:20:31 +0000 (17:20 +0200)]
bpo-30280: Cleanup threads in ayncio tests (#2501) (#2512)
* bpo-30280: asyncio now cleans up threads
asyncio base TestCase now uses threading_setup() and
threading_cleanup() of test.support to cleanup threads.
* asyncio: Fix TestBaseSelectorEventLoop cleanup
bpo-30280: TestBaseSelectorEventLoop of
test.test_asyncio.test_selector_events now correctly closes the event
loop: cleanup its executor to not leak threads.
Don't override the close() method of the event loop, only override
the_close_self_pipe() method.
Victor Stinner [Fri, 30 Jun 2017 11:12:15 +0000 (13:12 +0200)]
bpo-30813: Fix unittest when hunting refleaks (#2502) (#2506)
bpo-11798, bpo-16662, bpo-16935, bpo-30813: Skip
test_discover_with_module_that_raises_SkipTest_on_import() and
test_discover_with_init_module_that_raises_SkipTest_on_import() of
test_unittest when hunting reference leaks using regrtest.
(cherry picked from commit e4f9a2d2be42d5a2cdd624f8ed7cdf5028c5fbc3)
Add private C API function _PyUnicode_AsUnicode() which is similar to
PyUnicode_AsUnicode(), but checks for null characters..
(cherry picked from commit f7eae0adfcd4c50034281b2c69f461b43b68db84)
* regrtest --list-cases now supports --match and --match-file options.
Example: ./python -m test --list-cases -m FileTests test_os
* --list-cases now also sets support.verbose to False to prevent
messages to stdout when loading test modules.
* Add support._match_test() private function.
(cherry picked from commit ace56d583664f855d89d1219ece7c21c2fddcf30)
* Change the regrtest --huntrleaks checker to decide if a test file
leaks or not. Require that each run leaks at least 1 reference.
* Warmup runs are now completely ignored: ignored in the checker test
and not used anymore to compute the sum.
* Add an unit test for a reference leak.
Example of reference differences previously considered a failure
(leak) and now considered as success (success, no leak):
bpo-30764, bpo-29335: test_child_terminated_in_stopped_state() of
test_subprocess now uses support.SuppressCrashReport() to prevent the
creation of a core dump on FreeBSD.
(cherry picked from commit cdee3f14f7f4c995e7eedb0bf6a67e260c739f7d)
Brett Cannon [Fri, 23 Jun 2017 18:39:53 +0000 (11:39 -0700)]
[3.5] bpo-30645: don't append to an inner loop path in imp.load_package() (GH-2268) (GH-2365)
Bug didn't manifest itself when importing a module with source as .py files are always the first on the search path. The issue only showed up in bytecode-only packages where the calculated file path would be ``__init__.py/__init__.pyc``.
larryhastings [Thu, 22 Jun 2017 23:01:00 +0000 (16:01 -0700)]
Add "Misc/NEWS.d" directory tree for "blurb". GH-2330
CPython workflow is changing! We're going to start using "blurb"
to manage Misc/NEWS entries:
https://github.com/python/core-workflow
(This will be a big win for release managers, honest.)
This checkin simply populates the "Misc/NEWS.d" subdirectory tree
so that people can start putting their news entries in there.
No other changes (yet).
Victor Stinner [Tue, 20 Jun 2017 13:33:35 +0000 (15:33 +0200)]
bpo-30500: urllib: Simplify splithost by calling into urlparse. (#1849) (#2290)
The current regex based splitting produces a wrong result. For example::
http://abc#@def
Web browsers parse that URL as ``http://abc/#@def``, that is, the host
is ``abc``, the path is ``/``, and the fragment is ``#@def``.
(cherry picked from commit 90e01e50ef8a9e6c91f30d965563c378a4ad26de)
Victor Stinner [Fri, 16 Jun 2017 16:04:38 +0000 (18:04 +0200)]
[3.5] bpo-30540, bpo-30523: Add --matchfile and --list-cases options to regrtest (#2250)
* bpo-30540: regrtest: add --matchfile option
* Add a new option taking a filename to get a list of test names to
filter tests.
* support.match_tests becomes a list.
* Modify run_unittest() to accept to match the whole test identifier,
not just a part of a test identifier.
For example, the following command only runs test_access()
of the FileTests class of test_os:
$ ./python -m test -v -m test.test_os.FileTests.test_access test_os
* bpo-30523: regrtest: Add --list-cases option
* Add --list-cases option to regrtest
* Add get_abs_module() function, use it in list_cases()
* Add ns mandatory positional argument to runtest()
and runtest_inner()
* Add file optional parameter to printlist()
Mariatta [Fri, 16 Jun 2017 02:38:12 +0000 (19:38 -0700)]
[email] bpo-29478: Fix passing max_line_length=None from Compat32 policy (GH-595) (GH-2234)
If max_line_length=None is specified while using the Compat32 policy,
it is no longer ignored..
(cherry picked from commit b459f7482612d340b88b62edc024628595ec6337)
Victor Stinner [Thu, 15 Jun 2017 22:51:24 +0000 (00:51 +0200)]
Fix ref cycles in TestCase.assertRaises() (#193) (#2228)
bpo-23890: unittest.TestCase.assertRaises() now manually breaks a
reference cycle to not keep objects alive longer than expected.
(cherry picked from commit bbd3cf8f1ef1e91a8d6dac6411e18b4b9084abf5)
Victor Stinner [Thu, 15 Jun 2017 22:08:39 +0000 (00:08 +0200)]
bpo-30675: Fix multiprocessing code in regrtest (#2220)
* Rewrite code to pass slaveargs from the master process to worker
processes: reuse the same code of the Python master branch
* Move code to initialize tests in a new setup_tests() function,
similar change was done in the master branch
* In a worker process, call setup_tests() with the namespace built
from slaveargs to initialize correctly tests
Before this change, warm_caches() was not called in worker processes
because the setup was done before rebuilding the namespace from
slaveargs. As a consequence, the huntrleaks feature was unstable. For
example, test_zipfile reported randomly false positive on reference
leaks.
Serhiy Storchaka [Thu, 15 Jun 2017 14:16:55 +0000 (17:16 +0300)]
[3.5] bpo-29931 fix __lt__ check in ipaddress.ip_interface for both v4 and v6. (GH-879) (#2218)
the original logic was just comparing the network address
but this is wrong because if the network address is equal then
we need to compare the ip address for breaking the tie
The public cyrus.andrew.cmu.edu IMAP server (port 993) doesn't accept
TLS connection using our self-signed x509 certificate. Remove the two
tests which are already skipped.
Nick Coghlan [Tue, 13 Jun 2017 10:32:24 +0000 (20:32 +1000)]
[3.5] bpo-29514: Check magic number for bugfix releases (#2158)
Add a test to check the current MAGIC_NUMBER against the
expected number for the release if the current release is
at candidate or final level. On test failure, describe to
the developer the procedure for changing the magic number.
This ensures that pre-merge CI will automatically pick up
on magic number changes in maintenance releases (and
explain why those are problematic), rather than relying on
all core developers to be aware of the implications of
such changes.
Serhiy Storchaka [Mon, 12 Jun 2017 06:02:33 +0000 (09:02 +0300)]
[3.5] bpo-28994: Fixed errors handling in atexit._run_exitfuncs(). (GH-2034) (#2122)
The traceback no longer displayed for SystemExit raised in a callback registered by atexit.
(cherry picked from commit 3fd54d4a7e604067e2bc0f8cfd58bdbdc09fa7f4)
Mariatta [Sat, 10 Jun 2017 21:41:38 +0000 (14:41 -0700)]
bpo-28556: Updates to typing module (GH-2076) (GH-2088)
This PR contains two updates to typing module:
- Support ContextManager on all versions (original PR by Jelle Zijlstra).
- Add generic AsyncContextManager..
(cherry picked from commit 29fda8db16e0edab92841277fa223f844f5a92cc)
On Windows, subprocess.Popen.communicate() now also ignore EINVAL
on stdin.write() if the child process is still running but closed the
pipe.
(cherry picked from commit d52aa31378ae43e044a300edfe8285954c167216)
[3.5] bpo-30594: Fixed refcounting in newPySSLSocket (GH-1992) (#1993)
If pass a server_hostname= that fails IDNA decoding to SSLContext.wrap_socket or SSLContext.wrap_bio, then the SSLContext object had a spurious Py_DECREF called on it, eventually leading to segfaults.
(cherry picked from commit 65ece7ca2366308fa91a39a8dfa255e6bdce3cca)
Clarify that `two-pass` buffer can only be dumped once, and it prints out all text sent to it during all processing, even from Clinic blocks *after* the dumping point.
Mariatta [Mon, 5 Jun 2017 03:09:16 +0000 (20:09 -0700)]
bpo-30530: Update Descriptor How To Documentation (GH-1845) (GH-1954)
Update the code example in Functions and Methods section
Remove objtype argument in MethodType
(cherry picked from commit 1bced56567335745f91676192fc39c06aab30da9)
Brett Cannon [Sat, 3 Jun 2017 17:34:15 +0000 (10:34 -0700)]
[3.5] Turn on macOS builds for Travis (GH-1846) (GH-1930)
Initially the macOS builds are allowed to fail until such time that they can be determined to be stable and not add an unacceptable amount of time to the overall Travis-passing process.
(cherry picked from commit 21c2dd7cf8414c903f0e83cf1d6b7f02f645f422)
Mariatta [Thu, 1 Jun 2017 02:48:28 +0000 (19:48 -0700)]
bpo-22702: Clarify documentation of str.join & bytes.join (GH-156) (GH-1896)
The "iterable iterable" phrasing created confusion between the term
reference and the parameter name.
This simplifies the phrasing to just use the parameter name
without linking directly to the term definition.
(cherry picked from commit 08e2f355d04d3cbea5751ce1275306ee3f569b32)
csabella [Tue, 30 May 2017 20:47:47 +0000 (16:47 -0400)]
bpo-30354: Update data model documentation for super() (GH-1561) (GH-1869)
The data model section of the language reference was written well
before the zero-argument form of super() was added.
To avoid giving the impression that they're doing something
unusual, this updates the description of `__new__` and `__init__`
to use the zero-argument form.