Commit Graph

43298 Commits

Author SHA1 Message Date
Miss Islington (bot) 96bba049f4 bpo-33336, imaplib: Legalize MOVE command (GH-6569) (GH-8409)
imaplib now allows MOVE command in IMAP4.uid() (RFC 6851:
IMAP MOVE Extension) and potentially as a name of supported
method of IMAP4 object.
(cherry picked from commit caa331d492)

Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
2018-07-23 15:54:46 +02:00
Miss Islington (bot) ba1810e1ec bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406) (GH-8407)
When Python is installed on Windows, python -m test test_tools failed
because it tried to run Tools\scripts\2to3.py which requires an
argument. Skip this script. On other platforms or on Windows but when
run from source code (not installed), the script is called "2to3"
instead of "2to.py" and so was already skipped.

Modify also the unit test to unload all modules which have been
loaded by the test.
(cherry picked from commit 752d4b7531)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-23 14:39:11 +02:00
Miss Islington (bot) 05a72f15f7 bpo-21446: Update reload fixer to use importlib (GH-8391)
(cherry picked from commit 7a3056fa7d)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-23 11:11:22 +03:00
Miss Islington (bot) 14f58f0ff8 bpo-940286: Fix pydoc to show cross refs correctly (GH-8390)
(cherry picked from commit d04f46c59f)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
2018-07-23 09:51:54 +03:00
Serhiy Storchaka c7b91d95d8
[3.7] bpo-34189: Add simple tests for new Tk widget options. (GH-8396) (GH-8398)
(cherry picked from commit e271ca78e3)
(cherry picked from commit c75c1e0e8a)
2018-07-22 22:14:15 +03:00
Miss Islington (bot) 81f85d09f4 bpo-34181: Fix running Lib/test/test_typing.py as a script. (GH-8380) (GH-8385)
(cherry picked from commit 961360923e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-22 13:41:41 +03:00
Miss Islington (bot) 92ce6a64af bpo-34179: Make sure decimal context doesn't affect other tests. (GH-8376) (#8383)
(cherry picked from commit 938045f335)

Co-authored-by: Bo Bayles <bbayles@gmail.com>
2018-07-21 20:38:19 +02:00
Miss Islington (bot) 7638eb892a bpo-34126: Fix crashes while profiling invalid calls. (GH-8300) (GH-8371)
(cherry picked from commit 56868f940e)

Co-authored-by: jdemeyer <jdemeyer@cage.ugent.be>
2018-07-21 19:58:35 +03:00
Miss Islington (bot) a7a6eac966 bpo-33723: Fix test_time.test_process_time() (GH-8358) (GH-8362)
The test failed on my laptop because the busy loop took 15.9 ms
whereas the test expects at least 20 ms. Modify test_process_time()
as test_thread_time() has been modified recently: only require 15 ms
instead of 20 ms.
(cherry picked from commit e78dace8dc)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-21 03:52:44 +02:00
Miss Islington (bot) 03ec4df67d bpo-34008: Allow to call Py_Main() after Py_Initialize() (GH-8043) (GH-8352)
Py_Main() can again be called after Py_Initialize(), as in Python
3.6. The new configuration is ignored, except of
_PyMainInterpreterConfig.argv which is used to update sys.argv.
(cherry picked from commit fb47bca9ee)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-21 02:16:22 +02:00
Terry Jan Reedy 97c079c19a
bpo-34162: idlelib/NEWS.txt entries to 2018-7-20 (GH-8345) (GH-8347)
Cherry-picked from 2c5c0a3
2018-07-20 02:48:17 -04:00
Miss Islington (bot) 339e0c1296
bpo-32692: Fix test_threading.test_set_and_clear() (GH-8331)
Increase the timeout: give timeout x 4 instead of timeout x 2 to
threads to wait until the Event is set, but reduce the sleep from 500
ms to 250 ms. So the test should be more reliable and faster!
(cherry picked from commit 81950495ba)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-19 02:27:42 -07:00
Victor Stinner 296e572092
[3.7] bpo-34130: Fix 2 race conditions in test_signal (GH-8329)
* bpo-34130: Fix test_signal.test_socket() (GH-8326)

test_signal.test_socket(): On Windows, sometimes even if the C signal handler
succeed to write the signal number into the write end of the socketpair, the
test fails with a BlockingIOError on the non-blocking read.recv(1) because the
read end of the socketpair didn't receive the byte yet.

Fix the race condition on Windows by setting the read end as blocking.

(cherry picked from commit 99bb6df66a)

* bpo-34130: Fix test_signal.test_warn_on_full_buffer() (GH-8327)

On Windows, sometimes test_signal.test_warn_on_full_buffer() fails to
fill the socketpair buffer. In that case, the C signal handler
succeed to write into the socket, it doesn't log the expected send
error, and so the test fail.

On Windows, the test now uses a timeout of 50 ms to fill the
socketpair buffer to fix this race condition.

Other changes:

* Begin with large chunk size to fill the buffer to speed up the
  test.
* Add error messages to assertion errors to more easily identify
  which assertion failed.
* Don't set the read end of the socketpair as non-blocking.

(cherry picked from commit 686b4b5ff2)
2018-07-18 18:49:27 +02:00
Miss Islington (bot) 6020d98bea
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an exception set (GH-8282)
(cherry picked from commit 28f07364f0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-17 00:09:32 -07:00
Miss Islington (bot) 892df9d15a
bpo-33967: Fix wrong use of assertRaises (GH-8306)
(cherry picked from commit 56d8f57b83)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-07-16 22:18:56 -07:00
Miss Islington (bot) 0a820a2030 bpo-33967: Remove use of deprecated assertRaisesRegexp() (GH-8261) (GH-8296)
It was added in test_functools at 445f1b3.
(cherry picked from commit 9e9b2c32a3)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-16 11:40:11 +02:00
Miss Islington (bot) bbddd667a9 bpo-33911: Fixed deprecation warning in xmlrpc.server (GH-7847) (GH-8294)
Replace deprecated inspect.getfullargspec() with inspect.signature().
(cherry picked from commit 35c0809158)

Co-authored-by: Nicolas Noé <nicolas@niconoe.org>
2018-07-16 11:02:23 +02:00
Miss Islington (bot) c721472fb8
bpo-34087: Fix buffer overflow in int(s) and similar functions (GH-8274)
`_PyUnicode_TransformDecimalAndSpaceToASCII()` missed trailing NUL char.
It caused buffer overflow in `_Py_string_to_number_with_underscores()`.

This bug is introduced in 9b6c60cb.
(cherry picked from commit 16dfca4d82)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-07-13 20:58:12 -07:00
Miss Islington (bot) cf21d0031d bpo-34108: Fix double carriage return in 2to3 on Windows (GH-8271) (#8275)
* Add test capturing failure.
* Honor newlines as present in the original file.
(cherry picked from commit cafaf0447b)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2018-07-13 15:24:19 -04:00
Miss Islington (bot) 4ada0cff53
bpo-33723: Fix test_time.test_thread_time() (GH-8267)
The test failed on AMD64 Debian root 3.x buildbot because the busy
loop of 100 ms only increased time.thread_time() by 19.9 ms which is
smaller than 20 ms. Modify the test to tolerate a delta of at least
15 ms instead of 20 ms.
(cherry picked from commit d6345def68)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-12 07:05:43 -07:00
Miss Islington (bot) b89776fb1b
bpo-33716, test_concurrent_futures: increase timeout (GH-7828)
Increase the timeout from 1 min to 5 min.

Replace also time.time() with time.monotonic() for timeouts.
(cherry picked from commit 3ad8decd76)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2018-07-12 02:05:49 -07:00
Miss Islington (bot) 48d2aeb009
bpo-23927: Make getargs.c skipitem() skipping 'w*'. (GH-8192)
(cherry picked from commit 504373c59b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-11 09:56:05 -07:00
Miss Islington (bot) 0a1db32949 bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245) (GH-8247)
Change test_logging.SMTPHandlerTest timeout from 8 seconds to 1
minute. The test failed randomly on the slow x86 Gentoo Refleaks 3.7
buildbot.
(cherry picked from commit 31b50b8cbf)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-11 15:56:45 +02:00
Miss Islington (bot) 125371d2c6
bpo-34031: fix incorrect usage of self.fail in two tests (GH-8091)
Contributed by Bradley Laney.
(cherry picked from commit 6b490b5db4)

Co-authored-by: Bradley Laney <bradley.laney@gmail.com>
2018-07-10 03:08:43 -07:00
Miss Islington (bot) df9f633f94
bpo-33967: Fix singledispatch raised IndexError when no args (GH-8184)
(cherry picked from commit 445f1b35ce)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-07-10 00:48:57 -07:00
Miss Islington (bot) 958a25ea9f
Fixed several assertTrue() that were intended to be assertEqual(). (GH-8191)
Fixed also testing the "always" warning filter.
(cherry picked from commit b796e7dcdc)

Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
2018-07-09 08:47:14 -07:00
Serhiy Storchaka 7c43b80150
[3.7] bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684). (GH-8193)
(cherry picked from commit 2a9b8babf0)
2018-07-09 12:55:35 +03:00
Miss Islington (bot) a410f9f614
bpo-31014: Fix the webbrowser module. (GH-7267)
webbrowser._synthesize() called webbrowser.register() with
outdated signature.

Co-Authored-By: John Still <john@jmsdvl.com>
(cherry picked from commit 25b804a9c2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-08 01:09:21 -07:00
Miss Islington (bot) e019f98dc2
Fix typo in TypeVar docstring (GH-8142)
"can be used do declare" → "can be used to declare"
(cherry picked from commit 86bfed372b)

Co-authored-by: João D. Ferreira <jotomicron@gmail.com>
2018-07-07 09:05:36 -07:00
Miss Islington (bot) 7bd6f0e550
closes bpo-34056: Always return bytes from _HackedGetData.get_data(). (GH-8130)
* Always return bytes from _HackedGetData.get_data().

Ensure the imp.load_source shim always returns bytes by reopening the file in
binary mode if needed. Hash-based pycs have to receive the source code in bytes.

It's tempting to change imp.get_suffixes() to always return 'rb' as a mode, but
that breaks some stdlib tests and likely 3rdparty code, too.
(cherry picked from commit b0274f2cdd)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-07-06 21:00:45 -07:00
Miss Islington (bot) 4bd5fce27d
bpo-34054: multiprocessing uses time.monotonic() (GH-8118)
The multiprocessing module now uses the monotonic clock
time.monotonic() instead of the system clock time.time() to implement
timeouts.
(cherry picked from commit c2368cbc83)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-06 05:11:21 -07:00
Ammar Askar ab75d9e424 [3.7] bpo-33899: Make tokenize module mirror end-of-file is end-of-line behavior (GH-7891) (GH-8132)
Most of the change involves fixing up the test suite, which previously made
the assumption that there wouldn't be a new line if the input didn't end in
one.

Contributed by Ammar Askar.

(cherry picked from commit c4ef4896ea)
2018-07-06 13:21:05 +03:00
Miss Islington (bot) 3a7ee2817c
Fix typo in dataclasses documentation (GH-8102)
(cherry picked from commit e55ca3fdcb)

Co-authored-by: Artjom <tjomk@users.noreply.github.com>
2018-07-05 16:28:18 -07:00
Victor Stinner 29be3bd3c9
bpo-34044: subprocess.Popen copies startupinfo (GH-8090) (GH-8121)
subprocess.Popen now copies the startupinfo argument to leave it
unchanged: it will modify the copy, so that the same STARTUPINFO
object can be used multiple times.

Add subprocess.STARTUPINFO._copy() private method.

Python 3.7 backport from master makes the copy() private: renamed to
_copy().

(cherry picked from commit 483422f57e)
2018-07-05 23:15:28 +02:00
Xtreak f5770f354c bpo-33988: Fix test_warnings using -W error (GH-7985)
Use DeprecationWarning instead of PendingDeprecationWarning.
2018-07-05 18:59:46 +02:00
Miss Islington (bot) 51a346d075
Fix fuzz testing for marshal.loads(). (GH-8106)
(cherry picked from commit 09bb918a61)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-05 03:44:11 -07:00
Miss Islington (bot) 3f121a40c7
bpo-33720: Improve tests for the stack overflow in marshal.loads(). (GH-7336)
(cherry picked from commit fc05e68d8f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-05 01:45:24 -07:00
Miss Islington (bot) 6b3ff35670
bpo-32942: Fix environment dependent test_script_helper (GH-8034)
Result of function interpreter_requires_environment() depends on os.environ.
This was not covered by the tests, leading to fail when PYTHONHOME was set.
(cherry picked from commit a390cb6b6f)

Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
2018-07-04 03:35:08 -07:00
Miss Islington (bot) eb700f8c94
bpo-34040, multiprocessing: Fix test_forkserver_sigkill() (GH-8081)
Fix test_forkserver_sigkill() of test_multiprocessing_forkserver:
give more time to the first child process to complete, double the
sleep in the parent process.

Reduce also the child process sleep from 1000 ms to 500 ms, to not change
the total duration of the test.
(cherry picked from commit 07888e1cce)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-04 03:10:14 -07:00
Miss Islington (bot) c1b75b5fb9
bpo-34010: Fix tarfile read performance regression (GH-8020)
During buffered read, use a list followed by join instead of extending a bytes object.
This is how it was done before but changed in commit b506dc32c1.
(cherry picked from commit 12a08c4760)

Co-authored-by: hajoscher <hajoscher@gmail.com>
2018-07-04 01:32:41 -07:00
Miss Islington (bot) 20ae4c6025 bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918) (GH-8070)
PyErr_Print() will not return when the exception is a SystemExit, so
decref the __main__ module object in that case.
(cherry picked from commit d8cba5d16f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-03 22:13:28 +02:00
Miss Islington (bot) cee7b2261f
bpo-34019: Fix wrong arguments for Opera Browser (GH-8047)
The Opera Browser was using a outdated command line invocation that resulted in an incorrect URL being opened in the browser when requested using the webbrowser module.

* Correct the arguments passed to the Opera Browser when opening a new URL.
(cherry picked from commit 3cf1f154ed)

Co-authored-by: Bumsik Kim <k.bumsik@gmail.com>
2018-07-03 05:17:28 -07:00
Miss Islington (bot) 42b2f84a85
bpo-33735: Fix test_multiprocessing random failure (GH-8059)
When hunting memory leaks using -R 3:3, test_imap_unordered() of
test_multiprocessing leaks randomly a few memory blocks. It is a
false alarm: when testing using -R 3:20 for example, no leak is
detected.

Modify test_imap_unordered() to be closer to test_imap():

* Only test 10 numbers instead of 1000: it's a pool of 4 processes, so
  10 is enough to test at least one number per process
* Use chunksize=100 instead of chunksize=53 to mimick test_imap()
(cherry picked from commit 23401fb960)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-03 04:38:56 -07:00
Miss Islington (bot) 6f49afc3d9 bpo-33978: Close existing handlers before logging (re-)configuration. (GH-8008) (GH-8044)
(cherry picked from commit 087570af6d)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-07-02 10:35:09 +01:00
Miss Islington (bot) fd1c092bb9 bpo-32568: make select.epoll() and its docs consistent (GH-7840) (GH-8024)
* `flags` is indeed deprecated, but there is a validation on its value for
  backwards compatibility reasons.  This adds mention of this in the docs.
* The docs say that `sizehint` is deprecated and ignored, but it is still
  used when `epoll_create1()` is unavailable. This adds mention of this in
  the docs.
* `sizehint=-1` is acceptable again, and is replaced with `FD_SETSIZE-1`.
  This is needed to have a default value available at the Python level,
  since `FD_SETSIZE` is not exposed to Python. (see: bpo-31938)
* Reject `sizehint=0` since it is invalid to pass on to `epoll_create()`.

The relevant tests have also been updated.

(cherry picked from commit 0cdf5f4289)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-30 16:03:19 +03:00
Miss Islington (bot) 42ea522664
bpo-33974: Fix passing special characters to ttk widgets. (GH-7986)
Fix passing lists and tuples of strings containing special characters
'"', '\\', '{', '}' and '\n' as options to tkinter.ttk widgets.
(cherry picked from commit 5bb5bbfca8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-29 23:42:57 -07:00
Miss Islington (bot) eabebbb54c
bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918)
(cherry picked from commit 23db935bcf)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-29 03:34:34 -07:00
Miss Islington (bot) e2c5a753fa
bpo-14117: Make minor tweaks to turtledemo (GH-8002)
The 'wikipedia' example is now 'rosette', describing what it draws.
The 'penrose' print output is reduced.  The 'tree' '1024'
output is eliminated.
(cherry picked from commit 891a1f86d4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-28 22:30:44 -07:00
Miss Islington (bot) 3ed4414121
bpo-27500: Fix static version of getaddrinfo to resolve IPv6 (GH-7993)
(cherry picked from commit d904c238ca)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-28 19:16:48 -07:00
Miss Islington (bot) 4c20d2bf5d
bpo-33985: Implement ContextVar.name attribute. (GH-7980)
(cherry picked from commit 41cb0baea9)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-28 10:39:54 -07:00
Miss Islington (bot) ecb1525e10
bpo-33715: Fix multiprocessing test_wait_result() (GH-7971)
Increase timeouts from 10 seconds to 1 minute.
(cherry picked from commit 492572715a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-27 13:47:44 -07:00
Miss Islington (bot) 4b1d286ac0
bpo-33913: Fix test_multiprocessing_main_handling (GH-7972)
bpo-30339, bpo-33913:

* Increase timeout from 10 seconds to 1 minute in
  test_source_main_skipped_in_children source of
  test_multiprocessing_main_handling.
* Replace time.time() with time.monotonic().
* On timeout, include the duration in the error message.
(cherry picked from commit 64737e9ae2)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-27 13:41:39 -07:00
Miss Islington (bot) 34f2935dca
bpo-30356: Fix test_mymanager_context() of multiprocessing (GH-7968)
test_mymanager_context() now also accepts -SIGTERM as an expected
exitcode for the manager process. The process is killed with SIGTERM
if it takes longer than 1 second to stop.
(cherry picked from commit fbd7172325)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-27 09:38:37 -07:00
Victor Stinner 7b5856e7f0
Revert "bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)" (GH-7963)
This reverts commit 8b1ebcd7cb.
2018-06-27 15:17:34 +02:00
Miss Islington (bot) 8b1ebcd7cb
bpo-33929: multiprocessing: fix handle leak on race condition (GH-7921)
Fix a race condition in Popen of
multiprocessing.popen_spawn_win32. The child process now duplicates
the read end of pipe instead of "stealing" it.

Previously, the read end of pipe was "stolen" by the child process,
but it leaked a handle if the child process had been terminated
before it could steal the handle from the parent process.
(cherry picked from commit 2cc9d21fff)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-27 02:59:44 -07:00
Miss Islington (bot) 8eac0b8ed5
bpo-30317, test_multiprocessing: fix test_timeout() (GH-7957)
Tolerate a different of 50 ms, instead of just 30 ms, in
test_timeout() of multiprocessing tests. This change should fix such
test failure on Windows:

FAIL: test_timeout (test.test_multiprocessing_spawn.WithProcessesTestQueue)
Traceback (most recent call last):
  File "lib\test\_test_multiprocessing.py", line 753, in test_timeout
    self.assertGreaterEqual(delta, 0.170)
AssertionError: 0.16138982772827148 not greater than or equal to 0.17
(cherry picked from commit f15f66d275)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-27 02:22:43 -07:00
Miss Islington (bot) 0eaf7b975b bpo-24567: Random subnormal.diff (GH-7954) (GH-7955)
Handle subnormal weights for choices()
(cherry picked from commit ddf7171911)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2018-06-27 01:53:04 -07:00
Miss Islington (bot) ca97b64a65
bpo-33975: Avoid small type when running IDLE's htests. (GH-7944)
Import pyshell first in htest to call SetProcessDpiAwareness on Windows
before tkinter.Tk() is called for the htest. Apparently, 'root.destroy()'
undoes a previous 'root = Tk()'. Since IDLE unittests always destroy roots,
a unittest before an htest does not require anything more to work right.
Since part of the purpose of human-viewed tests is to determine that
widgets look right, it is important that they look the same for testing
as when running IDLE.
(cherry picked from commit 3c8043d8fa)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-26 21:37:51 -07:00
Ned Deily d4dd7db845 Sync the importlib magic number in test_importlib for 3.7.0 2018-06-26 23:00:18 -04:00
Ned Deily 8511b448a5 bpo-29514: Make magic number test work for candidates 2018-06-26 22:53:14 -04:00
Victor Stinner d1f9481b7a
bpo-33873: Backport regrtest from master to 3.7 (GH-7935)
* bpo-33718: regrtest: use format_duration() to display failed tests (GH-7686)

* Enhance also format_duration(): work on integers and rounds towards
  +infinity (math.ceil).
* Write unit tests on format_duration()

(cherry picked from commit 4ffe9c2b25)

* bpo-33873: regrtest: Add warning on -R 1:3 (GH-7736)

regrtest: Add warning when using less than 3 warmup runs like -R 1:3.
(cherry picked from commit cac4fef886)

* bpo-33873: Fix bug in `runtest.py` and add checks for invalid `-R` parameters (GH-7735)

Fix bug in `Lib/test/libregrtest/runtest.py` that makes running tests an extra time than the specified number of runs.

Add check for invalid --huntrleaks/-R parameters.

(cherry picked from commit 58ed7307ea)
2018-06-26 23:47:35 +02:00
Miss Islington (bot) ee60e36fbf
bpo-33924: Add missed mac-specific 'windows' to 'window' changes (GH-7920)
These should have been included in PR 7836.
(cherry picked from commit 42397731d7)

Co-authored-by: Mark Roseman <mark@markroseman.com>
2018-06-25 18:37:46 -07:00
Miss Islington (bot) b3bac968fe
bpo-33951: IDLE test_configdialog: call page.update in setUpClass (GH-7892)
This avoids a failure in at least one case when running only a single
test method rather than all tests in the module.

The issue came up when testing the following on Windows 10 Pro 64-bit:
HighPageTest.test_highlight_target_text_mouse
(cherry picked from commit 2af9f5d334)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-24 13:55:39 -07:00
Miss Islington (bot) 6b7ed31cf9
bpo-33950: Remove IDLE htest spec for a deleted file. (GH-7881)
In configdialog, the custom tabbedpages widget was replaced
by ttk.notebook several months ago.
(cherry picked from commit 5ae70f66ff)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-23 14:52:45 -07:00
Miss Islington (bot) bbef7abe92
bpo-33805: Improve error message of dataclasses.replace() (GH-7580)
(cherry picked from commit 3d70f7aef6)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-06-23 08:04:01 -07:00
Miss Islington (bot) 3747dd16d5
bpo-33932: Calling Py_Initialize() twice does nothing (GH-7845)
Calling Py_Initialize() twice does nothing, instead of failing with a
fatal error: restore the Python 3.6 behaviour.
(cherry picked from commit 209abf7469)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-22 10:33:48 -07:00
Miss Islington (bot) d554414d98
bpo-33905: Add test for idlelib.stackview.StackBrowser. (GH-7852)
Increases coverage by 44%.
(cherry picked from commit bcd3a1a18d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-21 19:48:45 -07:00
Miss Islington (bot) e1f0dceb26
bpo-33924: Change IDLE mainmenu.menudefs key 'windows' to 'window' (GH-7836)
Every other menudef key is the lowercase version of the
corresponding main menu entry (in this case, 'Window').
(cherry picked from commit 33c7420e7d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-20 21:35:47 -07:00
Miss Islington (bot) f9243a22da
bpo-33906: Rename idlelib.windows as window (GH-7833)
Match Window on the main menu and remove last plural module name.
Change imports, test, and attribute references to match new name.
(cherry picked from commit a361e89d5a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-20 18:45:36 -07:00
Miss Islington (bot) a717c5646b
bpo-33917: Fix and document idlelib/idle_test/template.py (GH-7830)
The revised file compiles, runs, and tests OK. idle_test/README.txt
explains how to use it to create new IDLE test files.
(cherry picked from commit 87a927325e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-20 14:27:43 -07:00
Miss Islington (bot) b0f352680e
bpo-33904: In IDLE's rstrip, rename class RstripExtension as Rstrip (GH-7811)
(cherry picked from commit 9bb92235f6)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్ రెడ్డి తాటిపర్తి) <srinivasreddy@users.noreply.github.com>
2018-06-20 08:56:22 -07:00
Miss Islington (bot) 232add0241
bpo-33746: Fix test_unittest.testRegisterResult() in verbose mode (GH-7799)
Only make sure that the result is in unittest.signals._results, don't
check the full content of unittest.signals._results.

support._run_suite() uses TextTestRunner in verbose mode, but
TextTestRunner.run() calls registerResult(result) which made the test
fail with "odd object in result set".

Call also removeResult() to restore unittest.signals._results to
avoid test side effect.
(cherry picked from commit fd8fbce495)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-20 02:50:03 -07:00
Miss Islington (bot) ce52f5ee09
bpo-33907: Rename an IDLE module and classes. (GH-7810)
Fix-up class name duplication in PR GH-7807. Combined effect is that
module calltips and its class CallTips are now calltip and Calltip.
In module calltip_w class CallTip is now CalltipWindow.
(cherry picked from commit 9af1836664)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-19 23:40:14 -07:00
Miss Islington (bot) b89a376b3b
bpo-33907: Rename an IDLE module and class. (GH-7807)
Improve consistency and appearance. Module idlelib.calltips is now calltip.
Class idlelib.calltip_w.CallTip is now Calltip.
(cherry picked from commit 06e2029dfa)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-19 20:27:37 -07:00
Miss Islington (bot) cbaee6fe02
bpo-33855: Still more edits and minimal tests for IDLE (GH-7784)
Part 3 of 3, continuing PR GH-7689. This covers 14 idlelib modules and their tests,
rpc to zoomheight except for run (already done) and tooltip (being done separately).
(cherry picked from commit 4d92158f4c)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-19 17:11:24 -07:00
Xiang Zhang 71ca738f4c
set terse to True when calling platform.platform in test.pythoninfo (GH-7797) 2018-06-20 01:32:49 +08:00
Victor Stinner 13c79c677f
bpo-33901: Fix test_dbm_gnu for gdbm 1.15 (GH-7798)
Fix test_dbm_gnu.test_reorganize() on macOS with gdbm 1.15: add a
larger value to make sure that the file size changes.
2018-06-19 18:19:23 +02:00
Miss Islington (bot) 2edcf0a3db
bpo-33365: print the header values beside the keys (GH-6611)
with debuglevel=1 only the header keys got printed. With
this change the header values get printed as well and the single
header entries get '\n' as a separator.
(cherry picked from commit 936f03e7fa)

Co-authored-by: Marco Strigl <mstrigl@suse.com>
2018-06-19 06:52:36 -07:00
Miss Islington (bot) 53d1e9fad3
bpo-33663: Convert content length to string before putting to header (GH-7754)
(cherry picked from commit b36b0a3765)

Co-authored-by: ValeriyaSinevich <valeriya.sinevich@phystech.edu>
2018-06-18 14:37:56 -07:00
Miss Islington (bot) 740f1cb20a
bpo-33855: More edits and new minimal tests for IDLE (GH-7761)
Part 2 of 3.  Continues PR GH-7689, changeset ee5ef30.
Edit and add tests for 18 modules, help_about to replace and run.
(cherry picked from commit ea3dc8029a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-18 02:10:38 -07:00
Miss Islington (bot) 6bb7704451
bpo-33856: Add "help" to the welcome message of IDLE (GH-7755)
Make it the same as when one runs 'python'.
(cherry picked from commit 9d49f85064)

Co-authored-by: Stéphane Wirtel <stephane@wirtel.be>
2018-06-16 14:37:55 -07:00
Miss Islington (bot) 633593372a
bpo-33861: Minor improvements of tests for os.path. (GH-7715)
* Test exists(), lexists(), isdir(), isfile(), islink(), ismount()
  with bytes paths.
* Remove unneeded silencing DeprecationWarning for ismount() with
  bytes path.
* Test common functions with unencodable and undecodable paths.
* Minor clean up and refactoring.
(cherry picked from commit 17a0088e26)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-16 03:57:50 -07:00
Miss Islington (bot) 5085687645
bpo-33855: Minimally test all IDLE modules. (GH-7689)
Create a template for minimally testing a tkinter-using module by importing it and instantiating its class(es).  Add a test file for all non-startup IDLE modules.  Edit existing files and update coverage.  This is part 1 of 3, covering the 21 autocomplete to help modules and touching 33 idlelib files.
(cherry picked from commit ee5ef309c7)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-15 15:38:35 -07:00
Victor Stinner ba67b4f7cb
Revert "bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)" (#7724)
This reverts commit 9b7c74ca32.
2018-06-15 23:37:33 +02:00
Victor Stinner ca4cb8492c
[3.7] bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7710)
* bpo-32962: python-gdb catchs ValueError on read_var() (GH-7692)

python-gdb now catchs ValueError on read_var(): when Python has no
debug symbols for example.

(cherry picked from commit 019d33b7a4)

* bpo-32962: python-gdb catchs UnicodeDecodeError (GH-7693)

python-gdb now catchs UnicodeDecodeError exceptions when calling
string().

(cherry picked from commit d22fc0bc7d)

* bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)

When Python is built with the intel control-flow protection flags,
-mcet -fcf-protection, gdb is not able to read the stack without
actually jumping inside the function. This means an extra
'next' command is required to make the $pc (program counter)
enter the function and make the stack of the function exposed to gdb.

(cherry picked from commit 9b7c74ca32)
2018-06-15 19:11:45 +02:00
Miss Islington (bot) 0e2b76ea4e
bpo-29456: Fix bugs in unicodedata.normalize: u1176, u11a7 and u11c3 (GH-1958)
Hangul composition check boundaries are wrong for the second character
([0x1161, 0x1176) instead of [0x1161, 0x1176]) and third character ((0x11A7, 0x11C3)
instead of [0x11A7, 0x11C3]).
(cherry picked from commit d134809cd3)

Co-authored-by: Wonsup Yoon <pusnow@me.com>
2018-06-15 05:21:55 -07:00
Miss Islington (bot) a50b825c18
bpo-33851: Fix ast.get_docstring() for a node that lacks a docstring. (GH-7682)
(cherry picked from commit 08f127a3ca)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-15 01:25:13 -07:00
Miss Islington (bot) 7b82281c80 bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7664)
When attempting to base64-decode a payload of invalid length (1 mod 4),
properly recognize and handle it.  The given data will be returned as-is,
i.e. not decoded, along with a new defect, InvalidBase64LengthDefect.
(cherry picked from commit c3f55be7dd)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-12 16:46:11 +03:00
Ned Deily dfad352267 3.7.0rc1 2018-06-12 00:46:50 -04:00
Miss Islington (bot) 8379b70be2 bpo-33582: Remove duplicate space in inspect.formatargspec() deprecation warning (GH-7655) (GH-7657)
(cherry picked from commit 41254ebd5e)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-12 00:25:31 -04:00
Miss Islington (bot) 42198571c5 bpo-31432: Revert unrelated code changes to _ssl.c and test_ssl (GH-7650) (GH-7651)
(cherry picked from commit 4531ec74c4)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 20:58:06 -04:00
Miss Islington (bot) a5db479ac4 bpo-31432: Clarify ssl CERT_NONE/OPTIONAL/REQUIRED docs. (GH-3530) (GH-7649)
The documentation for CERT_NONE, CERT_OPTIONAL, and CERT_REQUIRED were
misleading and partly wrong. It fails to explain that OpenSSL behaves
differently in client and server mode. Also OpenSSL does validate the
cert chain everytime. With SSL_VERIFY_NONE a validation error is not
fatal in client mode and does not request a client cert in server mode.
Also discourage people from using CERT_OPTIONAL in client mode.
(cherry picked from commit ef24b6c54d)

Co-authored-by: Christian Heimes <christian@python.org>
2018-06-11 19:20:24 -04:00
Miss Islington (bot) 6530577e29 bpo-33656: Mention color in idlelib/NEWS.txt entry. (GH-7646) (GH-7647)
(cherry picked from commit 4b704f29f5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 17:08:19 -04:00
Miss Islington (bot) 60b8274fec
bpo-33582: Emit deprecation warning for `formatargspec` (GH-6994)
(cherry picked from commit 46c5cd0f6e)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-06-11 13:44:16 -07:00
Miss Islington (bot) d26277a73b
bpo-33656: Add enum name for argument of Windows call. (GH-7642)
Change suggested by Eryk Sun in a comment on PR 7137 after it was merged.
(cherry picked from commit fd88f319a4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 13:06:36 -07:00
Miss Islington (bot) 144a8670f2
bpo-33656: On Windows, add API call saying that tk scales for DPI (GH-7137)
On Windows 8.1+ or 10, with DPI compatibility properties of the Python binary
unchanged, and a monitor resolution greater than 96 DPI, this should
make text and lines sharper. It should otherwise have no effect.

Using a magnifier, I determined that the improvement comes from horizontal and
lines being better lined up with the monitor pixels. I checked that this call causes
no problem on any Windows buildbot, including the Win7 buildbots. Unlike most
IDLE patches, this one can be easily reverted by users by removing a few lines,
at the top of idlelib/pyshell.py.
(cherry picked from commit 800415e3df)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-11 11:35:13 -07:00
Miss Islington (bot) a9846e0c70 pypi.python.org -> pypi.org (GH-7613) (GH-7614)
(cherry picked from commit 9d6d06e806)

Co-authored-by: Ned Deily <nad@python.org>
2018-06-11 01:05:22 -04:00
Miss Islington (bot) ec4343c3b4 bpo-30167: Prevent site.main() exception if PYTHONSTARTUP is set. (GH-6731) (GH-7606)
Before Python 3.6, os.path.abspath(None) used to report an AttributeError which was properly caught inside site.abs_paths, making it ignore __main__, one of sys.modules, which has __file__ and __cached__ set to None. With 3.6, os.path.abspath(None) raises TypeError instead which site.abs_path was not expecting.  This resulted in an uncaught exception if a user had PYTHONSTARTUP set and the application called site.main() which a number of third-party programs do.
(cherry picked from commit 2487f30d55)

Co-authored-by: Steve Weber <steverweber@gmail.com>
2018-06-10 21:21:35 -04:00
Miss Islington (bot) 037e912552 bpo-33812: Corrected astimezone for naive datetimes. (GH-7578) (GH-7600)
A datetime object d is aware if d.tzinfo is not None and
d.tzinfo.utcoffset(d) does  not return None. If d.tzinfo is None,
or if d.tzinfo is not None but d.tzinfo.utcoffset(d) returns None,
 d is naive.

This commit ensures that instances with non-None d.tzinfo, but
d.tzinfo.utcoffset(d) returning None are treated as naive.

In addition, C acceleration code will raise TypeError if
d.tzinfo.utcoffset(d) returns an object with the type other than
timedelta.

* Updated the documentation.

Assume that the term "naive" is defined elsewhere and remove the
not entirely correct clarification.  Thanks, Tim.
(cherry picked from commit 877b23202b)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2018-06-10 18:02:24 -04:00
Miss Islington (bot) 298eb07faa bpo-33748: fix tests altering sys.path and sys.modules (GH-7433) (#7604)
(cherry picked from commit 4ab4695388)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:45:19 -04:00
Miss Islington (bot) 053d6c5ce2 bpo-33770: improve base64 exception message for encoded inputs of invalid length (GH-7416) (GH-7602)
(cherry picked from commit 1b85c71a21)

Co-authored-by: Tal Einat <taleinat+github@gmail.com>
2018-06-10 17:37:14 -04:00
Miss Islington (bot) 2adfeef185
bpo-33610: Update IDLE Code Context doc entry (GH-7597)
Users can now click on context lines.
(cherry picked from commit af4b0130d4)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-10 13:07:24 -07:00
Miss Islington (bot) 463d1890bb
bpo-33718: regrtest: use "xxx then yyy" result if re-run (GH-7521)
If tests are re-run, use "xxx then yyy" result format (ex: "FAILURE
then SUCCESS") to show that some failing tests have been re-run.

Add also test_regrtest.test_rerun_fail() test.
(cherry picked from commit c45fc7673e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-09 09:33:24 -07:00
Miss Islington (bot) 8016c2bd69 Datetime test coverage (GH-7544) (GH-7551)
* Added a test case for strftime("%z").

The added test checks a case with UTC offest expressed in an integer
number of seconds.

* Added a test comparing naive and aware datetimes.

Check that a greater than  comparison of a naive  datetime instance with
an aware one raises a TypeError.

* Test datetime in fold or in gap comparison both ways.
(cherry picked from commit 4c3e39f61c)

Co-authored-by: Alexander Belopolsky <abalkin@users.noreply.github.com>
2018-06-08 23:11:23 -04:00
Miss Islington (bot) 21f4c780a1
bpo-30805: Avoid race condition with debug logging (GH-7545)
Supersedes https://github.com/python/cpython/pull/2490
(cherry picked from commit 12f482e0ae)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-08 15:42:07 -07:00
Miss Islington (bot) f44203d782
bpo-33802: Do not interpolate in ConfigParser while reading defaults (GH-7524)
This solves a regression in logging config due to changes in BPO-23835.
(cherry picked from commit 214f18e49f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2018-06-08 07:01:56 -07:00
Miss Islington (bot) 842985f6c7
bpo-11874: fix assertion failure in argparse metavar handling (GH-1826)
- bugfix and test for fragile metavar handling in argparse (see
  bpo-24089, bpo-14046, bpo-25058, bpo-11874)
- also fixes some incorrect tests that did not make 1-element tuples correctly
(cherry picked from commit 66f02aa32f)

Co-authored-by: wim glenn <wim.glenn@gmail.com>
2018-06-08 04:33:50 -07:00
Miss Islington (bot) 17beebcc8b
bpo-33694: Fix typo in helper function name (GH-7522)
_feed_data_to_bufferred_proto() renamed to
_feed_data_to_buffered_proto() ("bufferred" => "buffered").

Typo spotted by Nathaniel J. Smith.
(cherry picked from commit ff6c077292)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-08 01:48:50 -07:00
Miss Islington (bot) 76bef61b41
Update idlelib/NEWS.txt to 2018 Jun 8 am. (GH-7517)
(cherry picked from commit b1f690294d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-06-07 23:47:12 -07:00
Miss Islington (bot) a4868473e7
bpo-33768: IDLE: Clicking on code context line moves it to top of editor (GH-7411)
(cherry picked from commit 041272b657)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-07 22:50:36 -07:00
Miss Islington (bot) 0738443a5b
bpo-33792: Add selector and proactor windows policies (GH-7487)
(cherry picked from commit 8f4042964d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-07 18:31:50 -07:00
Miss Islington (bot) 8fa398d5ce bpo-33694: Fix race condition in asyncio proactor (GH-7498) (GH-7499)
The cancellation of an overlapped WSARecv() has a race condition
which causes data loss because of the current implementation of
proactor in asyncio.

No longer cancel overlapped WSARecv() in _ProactorReadPipeTransport
to work around the race condition.

Remove the optimized recv_into() implementation to get simple
implementation of pause_reading() using the single _pending_data
attribute.

Move _feed_data_to_bufferred_proto() to protocols.py.

Remove set_protocol() method which became useless.
(cherry picked from commit 79790bc35f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-08 00:49:34 +02:00
Miss Islington (bot) 0aee3bea19
bpo-33796: Ignore ClassVar for dataclasses.replace(). (GH-7488)
(cherry picked from commit e7adf2ba41)

Co-authored-by: Eric V. Smith <ericvsmith@users.noreply.github.com>
2018-06-07 13:15:23 -07:00
Miss Islington (bot) e4b2bdfdcf Improve the subprocess restore_signals=True test. (GH-7414) (GH-7437)
It wasn't testing functionality.  Now it is (on Linux anyways).
(cherry picked from commit 5f3d04fa4e)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2018-06-07 10:31:41 -07:00
Victor Stinner 3c417610ad
[3.7] bpo-33789: Backport test_asyncio fixes from master (GH-7478)
* bpo-33789: test_asyncio: Fix ResourceWarning (GH-7460)

* Close sockets and streams to fix ResourceWarning warnings
* Catch also OSError to hide a traceback on an expected handshake
  error

(cherry picked from commit 0eba7c3913)

* bpo-33789, test_asyncio: Hide PendingDeprecationWarning (GH-7461)

Hide PendingDeprecationWarning in test__register_task_3().

(cherry picked from commit 7ed61e9431)

* bpo-32676, test_asyncio: Fix warning in test_error_in_call_soon() (GH-7462)

Fix "<CoroWrapper ...> was never yielded from" warning in
PyTask_PyFuture_Tests.test_error_in_call_soon() of
test_asyncio.test_tasks.

Close manually the coroutine on error.

(cherry picked from commit 9f04f0df6f)
2018-06-07 16:19:00 +02:00
Miss Islington (bot) 4705ea38c9 update to Unicode 11.0.0 (closes bpo-33778) (GH-7439) (GH-7470)
Also, standardize indentation of generated tables.
(cherry picked from commit 7c69c1c0fb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2018-06-07 03:36:22 -04:00
Miss Islington (bot) d2a2af0df4
bpo-30436: Add missing space in importlib.util.find_spec() error message (GH-7385)
(cherry picked from commit fffeb6f3d6)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-06 23:21:43 -07:00
Miss Islington (bot) cebd4b009a bpo-28240: timeit: Update repeat() doc (GH-7419) (GH-7457)
Document that the default value of repeat changed from 3 to 5 in
Python 3.7.
(cherry picked from commit 3ef769fcd3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-06 19:05:46 +02:00
Miss Islington (bot) 016aff77cb
bpo-33773: Fix test.support.fd_count() on Linux/FreBSD (GH-7421)
Substract one because listdir() opens internally a file
descriptor to list the content of the /proc/self/fd/ directory.

Add test_support.test_fd_count().

Move also MAXFD code before msvcrt.CrtSetReportMode(), to make sure
that the report mode is always restored on failure.
(cherry picked from commit 492d6424a7)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-06 08:57:20 -07:00
Miss Islington (bot) e135032ffa bpo-33755: Fix importlib.resources isolation tests (GH-7412) (#7434)
(cherry picked from commit ac1ee1bada)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-06-05 12:11:40 -07:00
Miss Islington (bot) 1d419faccd
bpo-33751: Fix test_file. (GH-7378)
testModeStrings and testTruncateOnWindows were depended on
a file leaked in other tests.

Also improve cleaning up after tests.
(cherry picked from commit c2745d2d05)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-05 10:50:53 -07:00
Miss Islington (bot) 79c7e57c46 bpo-33769: start_tls: Fix error message; cancel callbacks on error (GH-7403) (GH-7428)
In addition to that, mark SSLTransport as "closed" in its "abort()" method to prevent bogus warnings.
(cherry picked from commit 415bc46a78)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-05 10:18:20 -04:00
Miss Islington (bot) ffd72acc50
bpo-33752: Fix a file leak in test_dbm. (GH-7376)
With addCleanup() f.close() was executed after tearDown().
(cherry picked from commit 6592d7fe11)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-05 06:50:56 -07:00
Miss Islington (bot) 631fe1fa42
bpo-33767: Fix improper use of SystemError by mmap.mmap objects (GH-7381)
Raise TypeError instead of SystemError for unsupported operations.
(cherry picked from commit e9e3976057)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-05 06:21:04 -07:00
Miss Islington (bot) fff25cc369
bpo-33753: Refactor creating temporary files in test_fileinput. (GH-7377)
(cherry picked from commit 5f48e2644d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-05 03:13:28 -07:00
Miss Islington (bot) 103058e19b
bpo-33720: Reduces maximum marshal recursion depth on release builds. (GH-7401)
(cherry picked from commit 2a4a62ba4a)

Co-authored-by: Steve Dower <steve.dower@microsoft.com>
2018-06-04 13:41:49 -07:00
Miss Islington (bot) d2c6ecc234
bpo-33509: Fix test_warnings for python3 -Werror (GH-7365)
Fix test_warnings.test_module_globals() when python3 is run with
-Werror.
(cherry picked from commit e292b75e3e)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-04 10:23:41 -07:00
Miss Islington (bot) b7eb1024d0
bpo-33763: IDLE: Replace label widget with text widget in code context (GH-7367)
(cherry picked from commit b609e687a0)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:33:23 -07:00
Miss Islington (bot) 87936d03cb bpo-33734: asyncio/ssl: a bunch of bugfixes (GH-7321) (GH-7396)
* Fix AttributeError (not all SSL exceptions have 'errno' attribute)

* Increase default handshake timeout from 10 to 60 seconds
* Make sure start_tls can be cancelled correctly
* Make sure any error in SSLProtocol gets propagated (instead of just being logged)
(cherry picked from commit 9602643120)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-06-04 12:05:46 -04:00
Miss Islington (bot) cfc12ec68c
bpo-33664: Scroll IDLE editor text by lines (GH-7351)
Previously, the mouse wheel and scrollbar slider moved text by a fixed
number of pixels, resulting in partial lines at the top of the editor
box. The change also applies to the shell and grep output windows,
but not to read-only text views.
(cherry picked from commit d49dbd9acc)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-04 09:05:24 -07:00
Miss Islington (bot) 7453caedbb bpo-33759: Fix test.test_xmlrpc.ServerProxyTestCase. (GH-7362) (GH-7371)
It depended on a global variable set by other tests.
(cherry picked from commit 7cfd8c6a1b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 23:16:48 -04:00
Miss Islington (bot) 4d11fe7cad bpo-33760: Fix file leaks in test_io. (GH-7361) (GH-7370)
(cherry picked from commit e36837cb71)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 23:15:10 -04:00
Miss Islington (bot) 2332fedb8d
bpo-33761: Fix a file leak in test_iterparse in test_xml_etree. (GH-7358)
(cherry picked from commit 13f51d9eec)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 12:02:20 -07:00
Miss Islington (bot) bdab3ea8b9 bpo-33750: Reset thread-local context precision in test_round(). (GH-7355) (#7357)
(cherry picked from commit e95dfc5006)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2018-06-03 19:36:34 +02:00
Miss Islington (bot) ad4c7954df bpo-33744: Fix test_uu. (GH-7350) (GH-7352)
Separate tests leaked files or were depended on files leaked in other tests.
(cherry picked from commit 027f95c736)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-06-03 18:23:53 +03:00
Miss Islington (bot) 8e0573029f
Docs: fix some wrong words (GH-6987)
Fix typos in code comments: bdb.py and configure.ac.
(cherry picked from commit b5c246f833)

Co-authored-by: Eitan Adler <grimreaper@users.noreply.github.com>
2018-06-02 07:36:19 -07:00
Miss Islington (bot) 4e033c5aa1
bpo-33679: IDLE: Re-enable color configuration for code context (GH-7199)
The difference from before is that the settings are now on the
Highlights tab instead of the Extensions tab and only change one theme
at a time instead of all themes. The default for light themes is black
on light gray, as before. The default for the IDLE Dark theme is white
on dark gray, which better fits the dark theme.

When one starts IDLE from a console and loads a custom theme without
definitions for 'context', one will see a warning message on the console.
To stop the warning, go to Options => Configure IDLE => Highlights,
select the custom theme if not selected already, select 'Code Context',
and select foreground and background colors.
(cherry picked from commit de6516264e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 19:16:04 -07:00
Miss Islington (bot) 0800b6c17a
bpo-33642: IDLE: Use variable number of lines in CodeContext. (GH-7106)
Instead of displaying a fixed number of lines, some blank, Code Context
now displays the variable number of actual context lines.  When there
are no context lines, it shows a single blank line to indicate that the
feature is turned on.

The Code Context configuration option is changed from 'numlines'
(default 3) to 'maxlines' (default 15) to avoid possible interference
between user settings for the old and new versions of Code Context.
(cherry picked from commit 29996a1c4e)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-06-01 16:45:54 -07:00
Miss Islington (bot) 63fa8db58c
bpo-33532: Fix test_multiprocessing_forkserver.test_ignore() (GH-7319)
Use also support.SOCK_MAX_SIZE, not only support.PIPE_MAX_SIZE, to
get the size for a blocking send into a multiprocessing pipe.
(cherry picked from commit 252f6abe0a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-01 08:21:21 -07:00
Victor Stinner 29ae9dc7c3
bpo-33540: Fix socketserver.ThreadingMixIn if block_on_close=False (GH-7309)
socketserver.ThreadingMixIn no longer tracks active threads if
block_on_close is false.
2018-06-01 14:07:50 +02:00
Victor Stinner 3dd802d8f2
bpo-33718: regrtest: update from master (GH-7305) 2018-06-01 12:29:39 +02:00
Victor Stinner 466aae5457
bpo-33692: Update pythoninfo from master (GH-7298)
* bpo-33692: pythoninfo detect libedit on Python 3.6 (GH-7293)
* bpo-33717: pythoninfo: add CC --version (GH-7290)
2018-06-01 12:10:07 +02:00
Serhiy Storchaka d6bbb57855
bpo-32911: Update the historical note about the magic number. (GH-7272) 2018-05-31 09:12:15 +03:00
Miss Islington (bot) 9d27334423
bpo-33532: Fix multiprocessing test_ignore() (GH-7262)
Fix test_ignore() of multiprocessing tests like
test_multiprocessing_forkserver: use support.PIPE_MAX_SIZE to make
sure that send_bytes() blocks.
(cherry picked from commit 5d6c7ed5e3)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-30 20:28:04 -07:00
Ned Deily abb8802389 3.7.0b5 2018-05-30 19:50:49 -04:00
Miss Islington (bot) d9b118284c Improve ensurepip's --help (GH-4686) (GH-7238)
* Add a space to ensurepip's --altinstall option
* Add periods to the arguments of ensurepip that didn't have it

This makes --help for all optional arguments consistent and also makes it
consistent with pip --help.
(cherry picked from commit e9537ad6a1)

Co-authored-by: Wieland Hoffmann <mineo@users.noreply.github.com>
2018-05-30 10:34:32 +02:00
Yury Selivanov af9cda9845
Revert "bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)" (GH-7233)
This reverts commit 2a7eb0b531.
2018-05-29 20:56:33 -04:00
Miss Islington (bot) 3ddee64587 bpo-32684: Fix nits in tests (GH-7225) (#7231)
(cherry picked from commit 6f75bae748)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 20:40:54 -04:00
Julien Palard 4f53e2ac16
[3.7] bpo-31639: Change ThreadedHTTPServer to ThreadingHTTPServer class name (GH-7195) (GH-7219)
* [3.7] bpo-31639: Change ThreadedHTTPServer to ThreadingHTTPServer class name (GH-7195).
(cherry picked from commit 1cee216cf3)

* Fix whatsnew entry about ThreadedHTTPServer. (GH-7220)
(cherry picked from commit a34e424bdb)
2018-05-30 02:24:17 +02:00
Miss Islington (bot) d8948c5e09
bpo-32751: Wait for task cancellation in asyncio.wait_for() (GH-7216)
Currently, asyncio.wait_for(fut), upon reaching the timeout deadline,
cancels the future and returns immediately.  This is problematic for
when *fut* is a Task, because it will be left running for an arbitrary
amount of time.  This behavior is iself surprising and may lead to
related bugs such as the one described in bpo-33638:

    condition = asyncio.Condition()
    async with condition:
        await asyncio.wait_for(condition.wait(), timeout=0.5)

Currently, instead of raising a TimeoutError, the above code will fail
with `RuntimeError: cannot wait on un-acquired lock`, because
`__aexit__` is reached _before_ `condition.wait()` finishes its
cancellation and re-acquires the condition lock.

To resolve this, make `wait_for` await for the task cancellation.
The tradeoff here is that the `timeout` promise may be broken if the
task decides to handle its cancellation in a slow way.  This represents
a behavior change and should probably not be back-patched to 3.6 and
earlier.
(cherry picked from commit e2b340ab41)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-05-29 15:37:06 -07:00
Miss Islington (bot) 036434273e bpo-32684: Fix gather to propagate cancel of itself with return_exceptions (GH-7209) (#7222)
(cherry picked from commit 863b674909)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 18:29:12 -04:00
Miss Islington (bot) 2a7eb0b531
bpo-22087: Fix Policy.get_event_loop() to detect fork (GH-7208)
Original patch by Dan O'Reilly.
(cherry picked from commit 5d97b7bcc1)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 14:09:17 -07:00
Miss Islington (bot) b3e12c0817 Attempt to fix test_stdin_broken_pipe on Travis (GH-7210) (#7211)
(cherry picked from commit 4fadf0c639)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 14:32:07 -04:00
Miss Islington (bot) cb055bcc2b bpo-33197: Update a error message of invalid inspect.Parameters. (GH-6636) (GH-7204)
(cherry picked from commit a9cab433bb)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-05-29 11:43:54 -04:00
Miss Islington (bot) 441afbd9c3
bpo-33353: test_asyncio use set_write_buffer_limits() (GH-7200)
Use transport.set_write_buffer_limits() in sendfile tests of
test_asyncio to make sure that the protocol is paused after sending
4 KiB. Previously,
test_sendfile_fallback_close_peer_in_the_middle_of_receiving() failed
on FreeBSD if the DATA was smaller than the default limit of 64 KiB.
(cherry picked from commit 9551f77192)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-29 07:21:46 -07:00
Miss Islington (bot) be5d616e55
bpo-33654: Support protocol type switching in SSLTransport.set_protocol() (GH-7194)
(cherry picked from commit 2179022d94)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-29 02:19:09 -07:00
Serhiy Storchaka 2641ee5040
bpo-32911: Revert bpo-29463. (GH-7121)
Remove the docstring attribute of AST types and restore docstring
expression as a first stmt in their body.

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-05-29 10:49:10 +03:00
Miss Islington (bot) eca085993c
bpo-33674: Pause the transport as early as possible (GH-7192)
(cherry picked from commit f295587c45)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 22:59:03 -07:00
Miss Islington (bot) 0dd8fd0358 bpo-33674: asyncio: Fix SSLProtocol race (GH-7175) (#7187)
Fix a race condition in SSLProtocol.connection_made() of
asyncio.sslproto: start immediately the handshake instead of using
call_soon(). Previously, data_received() could be called before the
handshake started, causing the handshake to hang or fail.
(cherry picked from commit be00a5583a)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-28 21:44:16 -04:00
Miss Islington (bot) 420092e255 bpo-32410: Avoid blocking on file IO in sendfile fallback code (GH-7172) (#7182)
(cherry picked from commit 7165754b6b)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 21:42:45 -04:00
Miss Islington (bot) ddc613f203
bpo-32610: Fix asyncio.all_tasks() to return only pending tasks. (GH-7174)
(cherry picked from commit 416c1ebd98)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 17:16:43 -07:00
Miss Islington (bot) 8d8b86116f
bpo-33469: RuntimeError after closing loop that used run_in_executor (GH-7171)
(cherry picked from commit fdccfe09f0)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 15:50:02 -07:00
Miss Islington (bot) 075c662086 bpo-33672: Fix Task.__repr__ crash with Cython's bogus coroutines (GH-7161) (GH-7173)
(cherry picked from commit 989b9e0e6d)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 18:31:07 -04:00
Miss Islington (bot) 4b828467a3
bpo-32458: Further tune start_tls tests (GH-7166)
(cherry picked from commit 8267ea2e84)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 13:44:12 -07:00
Miss Islington (bot) bc3a002e7d
bpo-33654: Support BufferedProtocol in set_protocol() and start_tls() (GH-7130)
In this commit:

* Support BufferedProtocol in set_protocol() and start_tls()
* Fix proactor to cancel readers reliably
* Update tests to be compatible with OpenSSL 1.1.1
* Clarify BufferedProtocol docs
* Bump TLS tests timeouts to 60 seconds; eliminate possible race from start_serving
* Rewrite test_start_tls_server_1
(cherry picked from commit dbf102271f)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 11:50:45 -07:00
Miss Islington (bot) f8fdb368e3 bpo-33505: Optimize asyncio.ensure_future by reordering if conditions (GH-6836) (#7162)
(cherry picked from commit e549c4be5f)

Co-authored-by: jimmylai <albert_chs@yahoo.com.tw>
2018-05-28 14:42:50 -04:00
Miss Islington (bot) 1f21ae710d bpo-31647: Fix write_eof() after close() for SelectorSocketTransport (GH-7149) (GH-7153)
Fixed bug where calling write_eof() on a _SelectorSocketTransport after
it's already closed raises AttributeError.
(cherry picked from commit 23f587e395)

Co-authored-by: twisteroid ambassador <twisteroidambassador@users.noreply.github.com>
2018-05-28 12:04:09 -04:00
Miss Islington (bot) 983c1ba94a bpo-32374: Ignore Python-level exceptions in test_bad_traverse (GH-7145) (GH-7150)
(cherry picked from commit 08c5aca9d1)

Co-authored-by: Marcel Plch <gmarcel.plch@gmail.com>
2018-05-28 14:52:03 +02:00
Miss Islington (bot) eb8516becc bpo-33400: Clarified documentation to indicate no strict adherence to ISO 8601. (GH-6702) (GH-6704)
(cherry picked from commit c4994dc00d)

Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
2018-05-28 13:29:13 +01:00
Miss Islington (bot) 98b089e2a1
bpo-33652: Remove __getstate__ and __setstate__ methods in typing. (GH-7144)
(cherry picked from commit 97b523db7c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-28 04:21:44 -07:00
Miss Islington (bot) 96fb828da3
bpo-33655: Also ignore test_posix_fallocate failures on BSD platforms (GH-7134)
The failure may be due to the use oF ZFS, a case we already ignore
for Solaris-based systems where ZFS is frequently used.
(cherry picked from commit 09c4a7dee2)

Co-authored-by: Ned Deily <nad@python.org>
2018-05-26 14:57:01 -07:00
Miss Islington (bot) e60f6e1864
bpo-21983: Fix a crash in ctypes.cast() when passed a ctypes structured data type (GH-3859)
(cherry picked from commit d518d8bc8d)

Co-authored-by: Oren Milman <orenmn@gmail.com>
2018-05-26 11:39:52 -07:00
Miss Islington (bot) d49862582e
bpo-33652: Improve pickle support in the typing module. (GH-7123)
Pickles of type variables and subscripted generics are now future-proof
and compatible with older Python versions.
(cherry picked from commit 09f3221fbb)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-26 11:38:00 -07:00
Miss Islington (bot) af1d007bdb
test.regrtest: flush stdout when display progress (GH-7105)
runtest_mp.py: call print() with flush=True.
(cherry picked from commit 4f0bc7f7ab)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-25 09:46:33 -07:00
Miss Islington (bot) d9eb22c67c
bpo-33629: Prevent coredump in test_importlib (GH-7090)
bpo-32374, bpo-33629: Use support.SuppressCrashReport() in
test_bad_traverse() of MultiPhaseExtensionModuleTests to prevent
leaking a core dump file.
(cherry picked from commit 483000e164)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-24 13:44:56 -07:00
Miss Islington (bot) b2ab5dc72b
bpo-33628: IDLE: Minor code cleanup of codecontext.py and its tests (GH-7085)
(cherry picked from commit 8506016f90)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-05-23 20:26:54 -07:00
Miss Islington (bot) dd7a255911 bpo-33109: argparse subparsers are once again not required by default (GH-6919) (GH-7089)
bpo-26510 in 3.7.0a2 changed the behavior of argparse to make
subparsers required by default, returning to the behavior of 2.7
and 3.2. The behavior was changed in 3.3 to be no longer required.
While it might make more sense to have the default to required,
compatibility with 3.3 through 3.6 is probably less disruptive
than trying to reintroduce compatibility with 2.7 at this point.
This change restores the 3.6 behavior.
(cherry picked from commit 8ebf5ceb0f)

Co-authored-by: Ned Deily <nad@python.org>
2018-05-23 22:22:46 -04:00
Miss Islington (bot) fa286edbde
bpo-33540: Add block_on_close attr to socketserver (GH-6911)
Add a new block_on_close class attribute to ForkingMixIn and
ThreadingMixIn classes of socketserver to opt-in for pre-3.7 behaviour.
(cherry picked from commit 453bd0bc65)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-23 18:34:43 -07:00
Victor Stinner fa24c1c5af
[3.7] bpo-33353: Fix test_asyncio on FreeBSD (GH-7087)
* bpo-33353: test_asyncio uses smaller sendfile data (#7083)

bpo-32622, bpo-33353: sendfile() tests of test_asyncio use socket
buffers of 1 kB "to test on relative small data sets". Send only
160 KiB rather 10 MB to make the test much faster.

Shrink also SendfileBase.DATA from 1600 KiB to 160 KiB.

On Linux, 3 test_sock_sendfile_mix_with_regular_send() runs now take
less than 1 second, instead of 18 seconds.

On FreeBSD, the 3 tests didn't hang, but took 3 minutes. Now
the 3 tests pass in less than 1 seconds.

(cherry picked from commit 2932755cc1)

* bpo-33353: test_asyncio set SO_SNDBUF after connect (GH-7086)

bpo-32622, bpo-33353: On macOS, sock.connect() changes the
SO_SNDBUF value. Only set SO_SNDBUF and SO_RCVBUF buffer sizes
once a socket is connected or binded, not before.

(cherry picked from commit b97de3dd86)
2018-05-24 03:21:14 +02:00
Miss Islington (bot) 72ef4fc32b [3.7] bpo-33618: Enable TLS 1.3 in tests (GH-7079) (GH-7082)
TLS 1.3 behaves slightly different than TLS 1.2. Session tickets and TLS
client cert auth are now handled after the initialy handshake. Tests now
either send/recv data to trigger session and client certs. Or tests
ignore ConnectionResetError / BrokenPipeError on the server side to
handle clients that force-close the socket fd.

To test TLS 1.3, OpenSSL 1.1.1-pre7-dev (git master + OpenSSL PR
https://github.com/openssl/openssl/pull/6340) is required.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 529525fb5a)
2018-05-23 22:49:04 +02:00
Miss Islington (bot) 0f9b68a728
Reverse the meaning of is_argument when used for type check (GH-7039)
(cherry picked from commit 0e61dffdba)

Co-authored-by: Nina Zakharenko <nzakharenko@gmail.com>
2018-05-22 20:51:15 -07:00
Miss Islington (bot) 2751dccca4
bpo-33604: Remove Pending from hmac Deprecation warning. (GH-7062)
bpo-33604: Bump removal notice from 3.6 to 3.8 and change PendingDeprecationWarning to DeprecationWarning as we had intended to do earlier...
(cherry picked from commit 8bb0b5b03c)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2018-05-22 16:40:44 -07:00
Miss Islington (bot) cd57b48ef9
bpo-33570: TLS 1.3 ciphers for OpenSSL 1.1.1 (GH-6976)
Change TLS 1.3 cipher suite settings for compatibility with OpenSSL
1.1.1-pre6 and newer. OpenSSL 1.1.1 will have TLS 1.3 cipers enabled by
default.

Also update multissltests and Travis config to test with latest OpenSSL.

Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit e8eb6cb792)

Co-authored-by: Christian Heimes <christian@python.org>
2018-05-22 14:40:46 -07:00
Miss Islington (bot) ca6d7aee91
Improve comments in test_idle.py. (GH-7057)
(cherry picked from commit 2a6d5da1d3)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-22 10:43:55 -07:00
Miss Islington (bot) 25fd6cc5b0
bpo-30877: Fix clearing a cache in the the JSON decoder. (GH-7048)
(cherry picked from commit ae00fb1d4f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-22 06:03:10 -07:00
Miss Islington (bot) 316f86911a
Use IPv4 only to avoid IP address collision (GH-7030)
(cherry picked from commit b7555babe9)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-05-21 05:30:06 -07:00
Miss Islington (bot) 4d39ade62a Fix asyncio flaky tests (GH-7023) (#7024)
(cherry picked from commit e253752191)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2018-05-21 14:47:29 +03:00
Miss Islington (bot) b8b800090f bpo-33263: Fix FD leak in _SelectorSocketTransport (GH-6450) (#7022)
* bpo-33263 Fix FD leak in _SelectorSocketTransport. (GH-6450)

Under particular circumstances _SelectorSocketTransport can try to add a reader
even the transport is already being closed. This can lead to FD leak and
invalid stated of the following connections. Fixed the SelectorSocketTransport
to add the reader only if the trasport is still active.
(cherry picked from commit a84d0b361a)

Co-authored-by: Vlad Starostin <drtyrsa@yandex.ru>
2018-05-21 11:35:25 +03:00
Miss Islington (bot) b85115ed4c [3.7] bpo-32262: Fix typo in f-string (GH-7016)
Fix typo from commit 6370f345e1

(cherry picked from commit d361e99868)
Co-authored-by: Christian Heimes <christian@python.org>
2018-05-20 20:22:50 +02:00
Miss Islington (bot) 073eca39a5
bpo-33542: Ignore DUID in uuid.get_node on Windows. (GH-6922)
uuid._ipconfig_getnode did not validate the maximum length of the value,
so long as the value had the same type of formatting as a MAC address.
This let it select DUIDs as MAC addresses. It now requires an exact
length match.
(cherry picked from commit c66c342cb4)

Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
2018-05-20 08:40:10 -07:00
Serhiy Storchaka b32f8897ea
[3.7] bpo-33475: Fix and improve converting annotations to strings. (GH-6774). (GH-6927)
(cherry picked from commit 64fddc423f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-20 18:06:08 +03:00
Miss Islington (bot) 52d1741c95 bpo-33584: Fix several minor bugs in asyncio. (GH-7003) (GH-7005)
Fix the following bugs in the C implementation:

* get_future_loop() silenced all exceptions raised when look up the get_loop
  attribute, not just an AttributeError.
* enter_task() silenced all exceptions raised when look up the current task,
  not just a KeyError.
* repr() was called for a borrowed link in enter_task() and task_step_impl().
* str() was used instead of repr() in formatting one error message (in
  Python implementation too).
* There where few reference leaks in error cases.
(cherry picked from commit 6655354afc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-20 17:34:28 +03:00
Miss Islington (bot) 28ea38b97b
bpo-26819: Prevent proactor double read on resume (GH-6921)
The proactor event loop has a race condition when reading with
pausing/resuming. `resume_reading()` unconditionally schedules the read
function to read from the current future. If `resume_reading()` was
called before the previously scheduled done callback fires, this results
in two attempts to get the data from the most recent read and an
assertion failure. This commit tracks whether or not `resume_reading`
needs to reschedule the callback to restart the loop, preventing a
second attempt to read the data.
(cherry picked from commit 4151061855)

Co-authored-by: CtrlZvi <viz+github@flippedperspective.com>
2018-05-20 03:57:32 -07:00
Miss Islington (bot) 222ae1eccc bpo-30928: Update idlelib/NEWS.txt. (GH-6995) (#6996)
(cherry picked from commit 6b0d09b8f0)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-19 22:01:26 -04:00
Miss Islington (bot) 0efa1353b7
bpo-32831: IDLE: Add docstrings and tests for codecontext (GH-5638)
(cherry picked from commit 654038d896)

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
2018-05-19 13:28:03 -07:00
Miss Islington (bot) 09ca5906b7 bpo-28556: Don't simplify unions at runtime (GH-6841) (GH-6979)
(cherry picked from commit f65e31fee3)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-05-18 16:27:14 -07:00
Miss Islington (bot) abde17e663 bpo-33556: Remove reference to thread module from docstring (GH-6963)
(cherry picked from commit 5634331a76)

Co-authored-by: Skip Montanaro <skip.montanaro@gmail.com>
2018-05-18 14:46:43 -05:00
Miss Islington (bot) b2a02b9d88 bpo-33564: Add async to IDLE's code context block openers. (GH-6960) (#6961)
(cherry picked from commit d89ca94847)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-17 22:04:23 -04:00
Miss Islington (bot) 56882db4f7 Provide a little better debug output (GH-6940) (#6942)
(cherry picked from commit 273f51f5ca)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-05-17 12:53:24 -04:00
Miss Islington (bot) 6417d33633 bpo-33537: Add an __all__ to importlib.resources (GH-6920) (#6941)
(cherry picked from commit 0ed66df524)

Co-authored-by: Barry Warsaw <barry@python.org>
2018-05-17 12:27:49 -04:00