Commit Graph

101509 Commits

Author SHA1 Message Date
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) 51d0a2c8dd
bpo-33623: Fix possible SIGSGV when asyncio.Future is created in __del__ (GH-7080)
(cherry picked from commit 35230d08e0)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-28 08:28:12 -07: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
Andrés Delfino e69657df24 [3.7] bpo-32769: A new take on annotations/type hinting glossary entries (GH-6829) (#7127)
(cherry picked from commit 6e33f810c9)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-05-26 10:17:33 -07:00
Miss Islington (bot) 14d289be60
bpo-33644: Fix signatures of tp_finalize handlers in testing code. (GH-7111)
(cherry picked from commit 19de8b3dd7)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-26 01:33:23 -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
Serhiy Storchaka ef91ddeae7
bpo-33012: Add -Wno-cast-function-type for gcc 8. (GH-6757) 2018-05-25 13:16:51 +03:00
Miss Islington (bot) 82d727fce6
Document typing.NoReturn (GH-7107)
(cherry picked from commit 6e413f4327)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
2018-05-24 21:51:14 -07:00
Miss Islington (bot) 5734f41a9b
bpo-32493: Fix uuid.uuid1() on FreeBSD. (GH-7099)
Use uuid_enc_be() if available to encode UUID to bytes as big endian.
(cherry picked from commit 17d8830312)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-24 16:22:59 -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) 2fe940c727
bpo-33622: Fix issues with handling errors in the GC. (GH-7078)
* Fixed a leak when the GC fails to add an object with __del__ into
  the gc.garbage list.
* PyGC_Collect() can now be called when an exception is set and
  preserves it.
* Fixed an undefined behavior with comparing a dead pointer with NULL.
(cherry picked from commit 301e3cc8a5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-24 05:39:08 -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) 508d7693bc bpo-33612: Remove PyThreadState_Clear() assertion (GH-7069) (GH-7074)
bpo-25612, bpo-33612: Remove an assertion from PyThreadState_Clear()
which failed at Python shutdown or on fork if a thread was running a
generator.
(cherry picked from commit b6dccf54fd)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2018-05-23 15:58:21 -04:00
Miss Islington (bot) 2fc443c469
bpo-32436: Document PEP 567 changes to asyncio. (GH-7073)
(cherry picked from commit 28b9178023)

Co-authored-by: Yury Selivanov <yury@magic.io>
2018-05-23 10:59:17 -07: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
Serhiy Storchaka 1f22a3003e
[3.7] Add missed details of the C API introduced in 3.7. (GH-7047) (GH-7061)
* Set the limited API version for PyImport_GetModule and PyOS_*Fork
  functions.
* Add PyImport_GetModule and Py_UTF8Mode in PC/python3.def.
* Add several functions in Doc/data/refcounts.dat.
(cherry picked from commit 4e29f566e8)
2018-05-22 22:26:42 +03:00
Miss Islington (bot) afec2d583a
bpo-33592: Document the C API in PEP 567 (contextvars) (GH-7033)
(cherry picked from commit b2f5f59ae1)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-05-22 10:58:01 -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
Serhiy Storchaka fecad4abe2
[3.7] Fix line breaks added after hyphens by blurb. (GH-7002) (GH-7050)
Also remove bullet asterisks from IDLE entries.
(cherry picked from commit aef639f626)
2018-05-22 14:53:08 +03:00
Miss Islington (bot) 3718f92e16
Add PyThread_tss_* to Doc/data/refcounts.dat. (GH-7038)
Thread Specific Storage (TSS) API is a public C API (new in 3.7).
(cherry picked from commit 55bfe690d5)

Co-authored-by: Masayuki Yamamoto <ma3yuki.8mamo10@gmail.com>
2018-05-22 01:59:33 -07:00
Miss Islington (bot) e1a78cacf6
bpo-5945: Improve mappings and sequences C API docs. (GH-7029)
(cherry picked from commit f5b1183610)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-22 01:23:20 -07:00
Miss Islington (bot) d9055f8176
Fix lambda parameters being refered as arguments (GH-7037)
(cherry picked from commit 268cc7c3f8)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-05-22 01:07:28 -07:00
Miss Islington (bot) 2b4ed5da1d bpo-33583: Add note in PyObject_GC_Resize() doc (GH-7021)
(cherry picked from commit 1179f4b40f)

Co-authored-by: INADA Naoki <methane@users.noreply.github.com>
2018-05-21 23:51:00 +09: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) 4ecdc1110d bpo-33580: Make binary/text file glossary entries follow most common "see also" style. (GH-6991) (GH-7012)
(cherry picked from commit 0c4be82890)

Co-authored-by: Andrés Delfino <adelfino@gmail.com>
2018-05-21 01:51:37 +03:00
Miss Islington (bot) 98a18def99 Add idlelib and IDLE section to What's New in 3.7. (GH-7019) (GH-7020)
(cherry picked from commit dd281873ba)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2018-05-20 17:44:12 -04: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
Miss Islington (bot) 736e3b3219 bpo-30940: Updating round() docs. (GH-6342) (GH-7009)
(cherry picked from commit 900c48dba3)

Co-authored-by: Lisa Roach <lisaroach14@gmail.com>
2018-05-20 18:28:15 +03:00
Miss Islington (bot) 296b60acd0 Docs: be less specific about python versions (GH-6985) (GH-7008)
CPython 3.5 is old now, and we don't bump this version often,
so lets avoid using specific versions.
(cherry picked from commit 9572132ab3)

Co-authored-by: Eitan Adler <grimreaper@users.noreply.github.com>
2018-05-20 18:14:39 +03: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) f0af69faee bpo-23722: Fix docs for future __classcell__ changes. (GH-6999) (GH-7000)
(cherry picked from commit 8ae8e6af37)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2018-05-20 08:49:13 +03:00
Elvis Pranskevichus 15f3d0cc76 [3.7] bpo-32996: The bulk of What's New in Python 3.7 (GH-6978). (GH-6998)
(cherry picked from commit 63536bd286)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2018-05-19 23:39:45 -04:00