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 caa331d492acc67d8f4edd16542cebfabbbe1e79)
bpo-25094: Fix test_tools.test_sundry() on Windows (GH-8406)
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.
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 81950495ba2c36056e0ce48fd37d514816c26747)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
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.
[3.6] bpo-34066: Disabled interruption before SETUP_WITH and BEFORE_ASYNC_WITH. (GH-8159) (GH-8198)
This will prevent emitting a resource warning when the execution was
interrupted by Ctrl-C between calling open() and entering a 'with' block
in "with open()".
(cherry picked from commit 3f4d90d4d72921f16babd3f52d7df804916af224)
The multiprocessing module now uses the monotonic clock
time.monotonic() instead of the system clock time.time() to implement
timeouts.
(cherry picked from commit c2368cbc83ca2bafeaea0e4760be4996046d0444)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
[3.6] bpo-33899: Make tokenize module mirror end-of-file is end-of-line behavior (GH-7891) (GH-8134)
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.
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 a390cb6b6fb6638e91d699513167e8f35b47f846)
Co-authored-by: Lorenz Mende <Lorenz.mende@gmail.com>
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 07888e1cce89e9bb7dc501e287b4cb126e01c378)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
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 b506dc32c1a.
(cherry picked from commit 12a08c47601cadea8e7d3808502cdbcca87b2ce2)
bpo-24596: Decref module in PyRun_SimpleFileExFlags() on SystemExit (GH-7918) (GH-8069)
PyErr_Print() will not return when the exception is a SystemExit, so
decref the __main__ module object in that case.
(cherry picked from commit d8cba5d16f1333fd625726fc72e66afbd45b8d00)
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.
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 23401fb960bb94e6ea62d2999527968d53d3fc65)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
bpo-34006: Revert line length limit for Windows help docs (GH-8051)
The line-length limit is not needed because the pages appear in a separate app rather
than on a browser tab. It can also interact badly with the DPI setting.
(cherry picked from commit d824ca7f4df9b5f77cf02490b0e98c2408e21fee)
Co-authored-by: Zachary Ware <zachary.ware@gmail.com>
bpo-25862: Fix several bugs in the _io module. (GH-8026)
They can be exposed when some C API calls fail due to lack of
memory.
* Failed Py_BuildValue() could cause an assertion error in the
following TextIOWrapper.tell().
* input_chunk could be decrefed twice in TextIOWrapper.seek()
after failed Py_BuildValue().
* initvalue could leak in StringIO.__getstate__() after failed
PyDict_Copy().
(cherry picked from commit fdb5a50ef34f7951c3b01eb77b1359725a9ad670)
Tal Einat [Sat, 30 Jun 2018 13:15:53 +0000 (16:15 +0300)]
[3.6] bpo-32568: make select.epoll() and its docs consistent (GH-7840) (GH-8025)
* `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()`.
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 5bb5bbfca847524bab5f2368bdb48eedf5dba74f)
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 891a1f86d415779cf67ca23e626a868e586feb05)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* 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.
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 fbd7172325e6ce55b6d5d3d7603e4c1c8a219cb8)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
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 f15f66d275d1166839312c9ff3a67c00b486c7d6)
Co-authored-by: Victor Stinner <vstinner@redhat.com>
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 3c8043d8fac4c0d05c0ba9e4e555e2f3165f2fe0)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
it's better to refer to PEP with `pep` role in reStructuredText. It also links to the PEP page.
(cherry picked from commit df748c20dabcec5a6e89e0dd74fff21110f8755a)
Co-authored-by: Behzad B. Mokhtari <35877268+perplexionist@users.noreply.github.com>
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 2af9f5d334eeca588eeee87d177faf0012c63a03)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
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 5ae70f66ff1949eec35ff207c97cfe572c4e74c8)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
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 33c7420e7dd9d8e5b2aa15e98da6291bab6fcf33)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>