Commit graph

23494 commits

Author SHA1 Message Date
Miss Islington (bot)
f17e001746
bpo-33476: Fix _header_value_parser when address group is missing final ';' (GH-7484)
(cherry picked from commit 8fe9eed937)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2018-07-28 08:59:18 -07:00
Ammar Askar
6ea8a3a0eb [3.6] bpo-29097: Forego fold detection on windows for low timestamp values (GH-2385) (GH-8498)
On Windows, passing a negative value to local results in an OSError because localtime_s on Windows does not support negative timestamps. Unfortunately this means that fold detection for timestamps between 0 and max_fold_seconds will result in this OSError since we subtract max_fold_seconds from the timestamp to detect a fold. However, since we know there haven't been any folds in the interval [0, max_fold_seconds) in any timezone, we can hackily just forego fold detection for this time range on Windows..
(cherry picked from commit 96d1e69a12)

Co-authored-by: Ammar Askar <ammar_askar@hotmail.com>
2018-07-27 10:59:27 -04:00
Miss Islington (bot)
cecbe0ade8 bpo-32663 Make SMTPUTF8SimTests run (GH-5314) (#8470)
Enable and fix SMTPUTF8SimTests in test_smtplib.

The tests for SMTPUTF8SimTests in test_smtplib.py were not actually
being run because test_smtplib was still using the 'test_main' pattern,
and the class was never added to test_main.

Additionally, one of the tests needed to be moved to the non-UTF8 server
class because it relies on the server not being UTF-8 compatible (and it
had a bug in in).
(cherry picked from commit 48ed88a93b)

Co-authored-by: chason <chason@gmail.com>
2018-07-26 10:02:22 -04:00
Serhiy Storchaka
113f86e748
[3.6] bpo-34164: Fix handling of incorrect padding in base64.b32decode(). (GH-8351) (GH-8436)
Now base64.Error is always raised instead of UnboundLocalError or
OverflowError.
(cherry picked from commit ac0b3c2f4d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-24 15:06:59 +03:00
Miss Islington (bot)
9b33ca0f4d [3.6] bpo-34136: Make test_do_not_recreate_annotations more reliable. (GH-8364) (GH-8366)
(cherry picked from commit 06ca3f0c09)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-24 15:06:19 +03:00
Miss Islington (bot)
ec729d5407 bpo-34084: Fix setting an error message for the "Barry as BDFL" easter egg. (GH-8262) (GH-8424)
(cherry picked from commit aba24ff360)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-07-24 01:41:48 +03:00
Miss Islington (bot)
1724c0c984
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.

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 05:34:20 -07:00
Miss Islington (bot)
9c136700aa bpo-34179: Make sure decimal context doesn't affect other tests. (GH-8376) (#8384)
(cherry picked from commit 938045f335)

Co-authored-by: Bo Bayles <bbayles@gmail.com>
2018-07-21 20:38:49 +02:00
Miss Islington (bot)
2fe1c6b386
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:44:29 -07:00
Miss Islington (bot)
e13180bc4c bpo-34130: Fix test_signal.test_socket() (GH-8326) (GH-8330)
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)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-07-18 19:02:06 +02:00
Serhiy Storchaka
cc13016658
bpo-34068: _io__IOBase_close_impl could call _PyObject_SetAttrId with an exception set (GH-8282). (GH-8312)
(cherry picked from commit 28f07364f0)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-17 10:33:14 +03:00
Miss Islington (bot)
8b5d191386
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:38:28 -07:00
Miss Islington (bot)
336c9539a9 bpo-33967: Remove use of deprecated assertRaisesRegexp() (GH-8261) (GH-8295)
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:26:49 +02:00
INADA Naoki
b2f8aa0c99
bpo-34087: Backport tests for int/float/complex (GH-8274)
Cherrypick tests from 16dfca4d82

While the regression is not in 3.6, it's worth to backport test cases
to 3.6 branch too.
2018-07-14 16:38:14 +09:00
Victor Stinner
8df4770e8d
bpo-33716, test_concurrent_futures: increase timeout (GH-7828) (GH-8264)
Increase the timeout from 1 min to 5 min.

Replace also time.time() with time.monotonic() for timeouts.

(cherry picked from commit 3ad8decd76)
2018-07-12 11:11:29 +02:00
Miss Islington (bot)
ec7562068f
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 10:10:40 -07:00
Victor Stinner
d68cb9d62c
bpo-34092, test_logging: increase SMTPHandlerTest timeout (GH-8245) (GH-8249)
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)
2018-07-11 13:14:36 +02:00
Miss Islington (bot)
cb14eb7eed
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:13:06 -07:00
Miss Islington (bot)
6ceab46a60
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 01:00:35 -07:00
Miss Islington (bot)
13d1025e43
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:54:27 -07:00
Miss Islington (bot)
d73497ba52 bpo-26544: Fixed implementation of platform.libc_ver(). (GH-7684). (GH-8193) (GH-8195)
(cherry picked from commit 2a9b8babf0)
(cherry picked from commit 7c43b80150)
2018-07-09 14:38:27 +03:00
Ammar Askar
11c36a3e16 [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.

Contributed by Ammar Askar.

(cherry picked from commit c4ef4896ea)
2018-07-06 13:22:25 +03:00
Miss Islington (bot)
e1adc65c53
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:34 -07:00
Miss Islington (bot)
878c4fe40e
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:48:47 -07:00
Miss Islington (bot)
aea19a0530
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:46:15 -07:00
Miss Islington (bot)
ae23d8de8d
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:15:13 -07:00
Miss Islington (bot)
e1ebf51f76 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 d8cba5d16f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-07-03 22:17:46 +02:00
Miss Islington (bot)
dd5f43a023
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:16:56 -07:00
Miss Islington (bot)
3bd9d3b934
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:51:00 -07:00
Xtreak
b6c1989168 [3.6] bpo-33978: Close existing handlers before logging (re-)configuration. (GH-8008). (GH-8045)
(cherry picked from commit 087570af6d)

Co-authored-by: Xtreak <tirkarthi@users.noreply.github.com>
2018-07-02 10:35:52 +01:00
Tal Einat
db7ac30ef5
[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()`.

The relevant tests have also been updated.

(cherry picked from commit 0cdf5f4289)
2018-06-30 16:15:53 +03:00
Miss Islington (bot)
b2e88fcf63
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:43:22 -07:00
Zackery Spytz
d6a283b37b [3.6] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918). (GH-8012)
(cherry picked from commit 23db935bcf)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2018-06-29 22:30:07 +03:00
Miss Islington (bot)
c00144cd77
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:22:39 -07:00
Miss Islington (bot)
404250ed65
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 14:20:09 -07:00
Victor Stinner
1d06be8cc5
bpo-33913: Fix test_multiprocessing_main_handling (GH-7972) (GH-7976)
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)
2018-06-27 23:14:53 +02:00
Miss Islington (bot)
a599323fc7
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:45:01 -07:00
Miss Islington (bot)
acda5ea916 bpo-24567: Random subnormal.diff (GH-7954) (GH-7956)
Handle subnormal weights for choices()
(cherry picked from commit ddf7171911)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2018-06-27 02:37:17 -07:00
Miss Islington (bot)
6abf8c1717
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:33:35 -07:00
Ned Deily
57389dbaa8
bpo-29514: Make magic number test work for candidates (GH-7945) 2018-06-26 23:55:07 -04:00
Victor Stinner
1d55888a78
bpo-33873: Backport regrtest from master to 3.7 (GH-7935) (GH-7937)
* 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)
(cherry picked from commit d1f9481b7a)
2018-06-27 00:44:43 +02:00
Miss Islington (bot)
6aa283a603 bpo-33717: set terse to True when calling platform.platform in test.pythoninfo (GH-7797) (GH-7802)
(cherry picked from commit 71ca738f4c)

Co-authored-by: Xiang Zhang <angwerzx@126.com>
2018-06-20 02:02:43 +08:00
Miss Islington (bot)
fe8122d7b7
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.
(cherry picked from commit 13c79c677f)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-06-19 09:45:39 -07:00
Miss Islington (bot)
34cd4821ed
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:44 -07:00
Miss Islington (bot)
5c23e21ef6
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:58:10 -07:00
Victor Stinner
74565aa6d5
Revert "bpo-32962: Fix test_gdb failure in debug build with -mcet -fcf-protection -O0 (GH-6754)" (#7725)
This reverts commit 9b7c74ca32.
2018-06-15 23:37:29 +02:00
Victor Stinner
5279759f52
bpo-32962: Backport python-gdb.py and test_gdb.py from master (GH-7710) (GH-7711)
* 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)

(cherry picked from commit ca4cb8492c)
2018-06-15 19:44:00 +02:00
Miss Islington (bot)
e2e7ff0d03
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:32:50 -07:00
Victor Stinner
142e3c08a4
[3.6] bpo-32356: idempotent pause_/resume_reading (GH-4914) (GH-7629)
Backport note: don't add new is_reading() method from master to 3.6.

(cherry picked from commit d757aaf9dd)
2018-06-13 12:05:15 +02:00
Miss Islington (bot)
63dd1f70c1 bpo-27397: Make email module properly handle invalid-length base64 strings (GH-7583) (GH-7665)
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:26 +03:00