]> granicus.if.org Git - python/log
python
5 years agobpo-37531: sync regrtest with master branch (GH-16285)
Victor Stinner [Thu, 19 Sep 2019 16:05:09 +0000 (18:05 +0200)]
bpo-37531: sync regrtest with master branch (GH-16285)

5 years agoFix _PyTraceMalloc_Fini() definition (GH-16259) (GH-16278)
Miss Islington (bot) [Thu, 19 Sep 2019 06:41:35 +0000 (23:41 -0700)]
Fix _PyTraceMalloc_Fini() definition (GH-16259) (GH-16278)

The function return type is void, not int.
(cherry picked from commit d299b8b47d9dbea8fec2c2abcb6c32ad32f5f4d1)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 years agoDoc: Clarify dict equality irrespective of ordering. (GH-16266)
Miss Islington (bot) [Thu, 19 Sep 2019 05:58:42 +0000 (22:58 -0700)]
Doc: Clarify dict equality irrespective of ordering. (GH-16266)

(cherry picked from commit 3171d67a6aaf7fe88685b3a80644f0284686ef63)

Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>
5 years ago[3.8] bpo-38218: Doc: Corrected syntax for return annotation (GH-16265) (GH-16274)
Miss Islington (bot) [Thu, 19 Sep 2019 05:42:57 +0000 (22:42 -0700)]
[3.8] bpo-38218: Doc: Corrected syntax for return annotation (GH-16265) (GH-16274)

Signed-off-by: Jason Plurad <pluradj@us.ibm.com>
(cherry picked from commit 9ab6038fe843e1193d795eb58fd5931b44be5a96)

Co-authored-by: Jason Plurad <pluradj@us.ibm.com>
5 years agobpo-38203: faulthandler.dump_traceback_later() is always available (GH-16260)
Victor Stinner [Wed, 18 Sep 2019 12:37:02 +0000 (14:37 +0200)]
bpo-38203: faulthandler.dump_traceback_later() is always available (GH-16260)

dump_traceback_later() and cancel_dump_traceback_later() functions of
the faulthandler module are always available since Python 3.7.

5 years ago[3.8] bpo-38070: Py_FatalError() logs runtime state (GH-16258)
Victor Stinner [Wed, 18 Sep 2019 12:10:16 +0000 (14:10 +0200)]
[3.8] bpo-38070: Py_FatalError() logs runtime state (GH-16258)

* bpo-38070: _Py_DumpTraceback() writes <no Python frame> (GH-16244)

When a Python thread has no frame, _Py_DumpTraceback() and
_Py_DumpTracebackThreads() now write "<no Python frame>", rather than
writing nothing.

(cherry picked from commit 8fa3e1740b3f03ea65ddb68411c2238c5f98eec2)

* bpo-38070: Enhance _PyObject_Dump() (GH-16243)

_PyObject_Dump() now dumps the object address for freed objects and
objects with ob_type=NULL.

(cherry picked from commit b39afb78768418d9405c4b528c80fa968ccc974d)

* bpo-38070: Add _PyRuntimeState.preinitializing (GH-16245)

Add _PyRuntimeState.preinitializing field: set to 1 while
Py_PreInitialize() is running.

_PyRuntimeState: rename also pre_initialized field to preinitialized.

(cherry picked from commit d3b904144e86e2442961de6a7dccecbe133d5c6d)

* bpo-38070: Py_FatalError() logs runtime state (GH-16246)

(cherry picked from commit 1ce16fb0977283ae42a9f8917bbca5f44aa69324)

5 years agobpo-37904: Edition on python tutorial - section 4 (GH-16169) (GH-16234)
Miss Islington (bot) [Wed, 18 Sep 2019 10:36:15 +0000 (03:36 -0700)]
bpo-37904: Edition on python tutorial - section 4 (GH-16169) (GH-16234)

A little change on first paragraph of python tutorial to be more clearly

https://bugs.python.org/issue37904

Automerge-Triggered-By: @ericvsmith
(cherry picked from commit b57481318e3e3cbacd398b898f9849ec8f2d7eec)

Co-authored-by: Diego Alberto Barriga Martínez <diegobarriga@protonmail.com>
5 years agobpo-38191: Use positional-only parameters in TypedDict(). (GH-16240)
Serhiy Storchaka [Wed, 18 Sep 2019 06:08:01 +0000 (09:08 +0300)]
bpo-38191: Use positional-only parameters in TypedDict(). (GH-16240)

5 years agobpo-36546: No longer a need to make "data" positional only (GH-16252) (GH-16253)
Miss Islington (bot) [Wed, 18 Sep 2019 04:06:53 +0000 (21:06 -0700)]
bpo-36546: No longer a need to make "data" positional only (GH-16252) (GH-16253)

(cherry picked from commit 272d0d017aef585acf84bb0af99a90a2a8582b2c)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). (GH-16222)
Miss Islington (bot) [Tue, 17 Sep 2019 18:41:55 +0000 (11:41 -0700)]
bpo-38191: Accept arbitrary keyword names in NamedTuple() and TypedDict(). (GH-16222)

This includes such names as "cls", "self", "typename", "_typename",
"fields" and "_fields".
Passing positional arguments by keyword is deprecated.
(cherry picked from commit 2bf31ccab3d17f3f35b42dca97f99576dfe2fc7d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-38013: make async_generator_athrow object tolerant to throwing exceptions (GH...
Miss Islington (bot) [Tue, 17 Sep 2019 13:20:06 +0000 (06:20 -0700)]
bpo-38013: make async_generator_athrow object tolerant to throwing exceptions (GH-16070)

Even when the helper is not started yet.

This behavior follows conventional generator one.
There is no reason for `async_generator_athrow` to handle `gen.throw()` differently.

https://bugs.python.org/issue38013
(cherry picked from commit c275312a6284bd319ea33c9abd7e15c230eca43f)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
5 years agobpo-37531: regrtest main process uses shorter timeout (GH-16220) (GH-16224)
Miss Islington (bot) [Tue, 17 Sep 2019 12:34:13 +0000 (05:34 -0700)]
bpo-37531: regrtest main process uses shorter timeout (GH-16220) (GH-16224)

When using multiprocesss (-jN), the main process now uses a timeout
of 60 seconds instead of the double of the --timeout value. The
buildbot server stops a job which does not produce any output in 1200
seconds.
(cherry picked from commit 46b0b81220a23bc4aee5ba3ba67e8cf1b5df7960)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
5 years agobpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)
Miss Islington (bot) [Tue, 17 Sep 2019 11:35:56 +0000 (04:35 -0700)]
bpo-37828: Fix default mock_name in unittest.mock.assert_called error (GH-16166)

In the format string for assert_called the evaluation order is incorrect and hence for mock's without name, 'None' is printed whereas it should be 'mock' like for other messages. The error message is ("Expected '%s' to have been called." % self._mock_name or 'mock').
(cherry picked from commit 5f5f11faf9de0d8dcbe1a8a4eb35d2a4232d6eaa)

Co-authored-by: Abraham Toriz Cruz <awonderfulcode@gmail.com>
5 years agoDoc: Fix grammar/spelling in ssl.VERIFY_CRL_CHECK_LEAF docs (GH-16221)
Miss Islington (bot) [Tue, 17 Sep 2019 10:49:20 +0000 (03:49 -0700)]
Doc: Fix grammar/spelling in ssl.VERIFY_CRL_CHECK_LEAF docs (GH-16221)

(cherry picked from commit 219fb9d65ef7e5363eccc9dde0988bb085db1c86)

Co-authored-by: Jörn Heissler <joernheissler@users.noreply.github.com>
5 years agobpo-38192: Fix remaining passing of "loop" in the protocol examples (GH-16202)
Miss Islington (bot) [Tue, 17 Sep 2019 07:24:31 +0000 (00:24 -0700)]
bpo-38192: Fix remaining passing of "loop" in the protocol examples (GH-16202)

See https://bugs.python.org/issue38192 .

https://bugs.python.org/issue38192
(cherry picked from commit 5d359cc62e0244e1fd8d17146a4135079d6843bf)

Co-authored-by: Hrvoje Nikšić <hniksic@gmail.com>
5 years agobpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH...
Miss Islington (bot) [Tue, 17 Sep 2019 06:39:11 +0000 (23:39 -0700)]
bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)

(cherry picked from commit f669581a9527afb0d2325f9845a86715c0ba365d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)
Miss Islington (bot) [Tue, 17 Sep 2019 06:23:12 +0000 (23:23 -0700)]
bpo-35379: When exiting IDLE, catch any AttributeError. (GH-16212)

One happens when EditorWindow.close is called twice.
Printing a traceback, when IDLE is run from a terminal,
is useless and annoying.
(cherry picked from commit dfd34a9cd58e8150c324190f746de919e140abe8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
Miss Islington (bot) [Tue, 17 Sep 2019 06:14:20 +0000 (23:14 -0700)]
bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)

(cherry picked from commit 8debfa50407107ff2329d01081cdc12d359f1d12)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years agoDoc: Add list(dict) in stdtypes library (GH-16209) (GH-16210)
Miss Islington (bot) [Tue, 17 Sep 2019 05:05:33 +0000 (22:05 -0700)]
Doc: Add list(dict) in stdtypes library (GH-16209) (GH-16210)

(cherry picked from commit 63dedef48bba9d54f13b958237696505fa665796)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
5 years agobpo-38183: Test_idle ignores user config directory GH-16198)
Miss Islington (bot) [Tue, 17 Sep 2019 03:32:55 +0000 (20:32 -0700)]
bpo-38183: Test_idle ignores user config directory GH-16198)

It no longer tries to create or access .idlerc or any files within.
Users must run IDLE to discover problems with saving settings.
(cherry picked from commit 0048afc16a7e7301d5c565237db271505e5fbed9)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
5 years agobpo-28556: Update the opening note in typing docs (GH-16204)
Miss Islington (bot) [Mon, 16 Sep 2019 22:11:10 +0000 (15:11 -0700)]
bpo-28556: Update the opening note in typing docs (GH-16204)

This PR replaces the old note mentioning that `typing` is a provisional module with a new one mentioning types are not enforced at runtime. I am not sure if there was any official announcement about making `typing` non-provisional, but _de-facto_ no new features were added during Python 3.7, and no backwards incompatible changes were made except for few small things that were considered bugs.
(cherry picked from commit 81528ba2e81c39f4d6bca5b785e818c7d08b8501)

Co-authored-by: Ivan Levkivskyi <levkivskyi@gmail.com>
5 years agobpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)
Miss Islington (bot) [Mon, 16 Sep 2019 19:48:03 +0000 (12:48 -0700)]
bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)

``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``.

https://bugs.python.org/issue33936
(cherry picked from commit 724f1a57231f9287c37255adf0e4364d12cf693d)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agoDoc: Fix Wikipedia link for functools.lru_cache (GH-16183)
Miss Islington (bot) [Mon, 16 Sep 2019 18:55:04 +0000 (11:55 -0700)]
Doc: Fix Wikipedia link for functools.lru_cache (GH-16183)

(cherry picked from commit 336b3064d8981bc7f76c5cc6f6a0527df69771d6)

Co-authored-by: amist <amistern0@gmail.com>
5 years agobpo-38100: Fix spelling error in unittest.mock code (GH-16168)
Miss Islington (bot) [Mon, 16 Sep 2019 16:52:45 +0000 (09:52 -0700)]
bpo-38100: Fix spelling error in unittest.mock code (GH-16168)

(cherry picked from commit a9187c31185fe7ea47271839898416400cc3d976)

Co-authored-by: marcoramirezmx <55331462+marcoramirezmx@users.noreply.github.com>
5 years agoDoc: Add link of GNU Readline library to interpreter tutorial (GH-16152) (GH-16189)
Miss Islington (bot) [Mon, 16 Sep 2019 16:30:04 +0000 (09:30 -0700)]
Doc: Add link of GNU Readline library to interpreter tutorial (GH-16152) (GH-16189)

(cherry picked from commit f18242be16714da2cfe013dbadfaf2e31d971562)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
5 years agobpo-38081: Add more non-fatal error codes for ntpath.realpath (GH-16156)
Miss Islington (bot) [Mon, 16 Sep 2019 14:43:36 +0000 (07:43 -0700)]
bpo-38081: Add more non-fatal error codes for ntpath.realpath (GH-16156)

(cherry picked from commit 89b8933bb537179f81003928786c5cc6183af591)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agobpo-38117: Update bundled Windows OpenSSL to 1.1.1d (GH-16184)
Miss Islington (bot) [Mon, 16 Sep 2019 14:40:19 +0000 (07:40 -0700)]
bpo-38117: Update bundled Windows OpenSSL to 1.1.1d (GH-16184)

(cherry picked from commit 3ab73f6bbf4ff66e7ace3c4eab25461b5c7d71d4)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agobpo-38153: detect shake independently from sha3 (GH-16143)
Miss Islington (bot) [Mon, 16 Sep 2019 12:28:32 +0000 (05:28 -0700)]
bpo-38153: detect shake independently from sha3 (GH-16143)

XOF digests (SHAKE) are not available in OpenSSL 1.1.0 but SHA3 fixed-length digests are.

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

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-33095: Add reference to isolated mode in -m and script option (GH-7764)
Miss Islington (bot) [Mon, 16 Sep 2019 12:21:03 +0000 (05:21 -0700)]
bpo-33095: Add reference to isolated mode in -m and script option (GH-7764)

Attempt to make isolated mode easier to discover via additional inline documentation.

Co-Authored-By: Julien Palard <julien@palard.fr>
(cherry picked from commit bdd6945d4dbd1fe6a7fcff95f7d6908db7d791a1)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
5 years ago[3.8] bpo-38153: Normalize hashlib algorithm names (GH-16083) (GH-16144)
Christian Heimes [Mon, 16 Sep 2019 12:08:55 +0000 (14:08 +0200)]
[3.8] bpo-38153: Normalize hashlib algorithm names (GH-16083) (GH-16144)

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

Co-authored-by: Christian Heimes <christian@python.org>
5 years agoDoc: remove duplicate word in controlflow tutorial (GH-16163)
Miss Islington (bot) [Mon, 16 Sep 2019 07:13:14 +0000 (00:13 -0700)]
Doc: remove duplicate word in controlflow tutorial (GH-16163)

(cherry picked from commit b7af4e75657e6478920d00260c48a1a3020002fc)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
5 years ago[3.8] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH...
Miss Islington (bot) [Mon, 16 Sep 2019 06:26:57 +0000 (23:26 -0700)]
[3.8] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH-16174)

(cherry picked from commit 56a45142e70a1ccf3233d43cb60c47255252e89a)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
https://bugs.python.org/issue38168

Automerge-Triggered-By: @zhangyangyu
5 years agobpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. (GH-16170)
Miss Islington (bot) [Mon, 16 Sep 2019 02:57:28 +0000 (19:57 -0700)]
bpo-38117: Updated OpenSSL to 1.1.1d in macOS installer. (GH-16170)

(cherry picked from commit 24d1597e430498ebe2d3d18fba2cacb3957b494d)

Co-authored-by: Ned Deily <nad@python.org>
5 years agobpo-38178: Don't explicitly pass "loop" to EchoClientProtocol. (GH-16159)
Miss Islington (bot) [Sun, 15 Sep 2019 17:13:34 +0000 (10:13 -0700)]
bpo-38178: Don't explicitly pass "loop" to EchoClientProtocol. (GH-16159)

https://bugs.python.org/issue38178
(cherry picked from commit c717c73fa33a2f3591442059eaf6e7a673e2c725)

Co-authored-by: Hrvoje Nikšić <hniksic@gmail.com>
5 years agobpo-37798: Prevent undefined behavior in direct calls to the C helper function. ...
Miss Islington (bot) [Sun, 15 Sep 2019 17:04:00 +0000 (10:04 -0700)]
bpo-37798: Prevent undefined behavior in direct calls to the C helper function. (GH-16149) (GH-16160)

(cherry picked from commit 6e27a0d77520bf2c4412e367496212510f81b983)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-38158: Removing nonexistant member "doc" from PyType_Spec documentation (GH-16142...
Miss Islington (bot) [Sun, 15 Sep 2019 07:00:44 +0000 (00:00 -0700)]
bpo-38158: Removing nonexistant member "doc" from PyType_Spec documentation (GH-16142) (GH-16154)

(cherry picked from commit 8b31a11a698cb5aa9b439b349c8de4e388846f73)

Co-authored-by: t k <tahia.khan@utoronto.ca>
5 years agobpo-37635: Update arg name for seek() in IO tutorial (GH-16147)
Miss Islington (bot) [Sat, 14 Sep 2019 20:47:31 +0000 (13:47 -0700)]
bpo-37635: Update arg name for seek() in IO tutorial (GH-16147)

Typically, the second positional argument for ``seek()`` is *whence*. That is the POSIX standard name (http://man7.org/linux/man-pages/man3/lseek.3p.html) and the name listed in the documentation for ``io`` module (https://docs.python.org/3/library/io.htmlGH-io.IOBase.seek).

The tutorial for IO is the only location where the second positional argument for ``seek()`` is referred to as *from_what*. I suspect this was created at an early point in Python's history, and was never updated (as this section predates the GitHub repository):

```
$ git grep "from_what"
Doc/tutorial/inputoutput.rst:To change the file object's position, use ``f.seek(offset, from_what)``.  The position is computed
Doc/tutorial/inputoutput.rst:the *from_what* argument.  A *from_what* value of 0 measures from the beginning
Doc/tutorial/inputoutput.rst:the reference point.  *from_what* can be omitted and defaults to 0, using the
```

For consistency, I am suggesting that the tutorial be updated to use the same argument name as the IO documentation and POSIX standard for ``seek()``, particularly since this is the only location where *from_what* is being used.

Note: In the POSIX standard, *whence* is technically the third positional argument, but the first argument *fildes* (file descriptor) is implicit in Python.

https://bugs.python.org/issue37635
(cherry picked from commit ff603f6c3d3dc0e9ea8c1c51ce907c4821f42c54)

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
5 years ago[3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH...
Serhiy Storchaka [Sat, 14 Sep 2019 16:36:19 +0000 (19:36 +0300)]
[3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ChannelID. (GH-15652) (GH-16145)

* Fix a crash in comparing with float (and maybe other crashes).
* They are now never equal to strings and non-integer numbers.
* Comparison with a large number no longer raises OverflowError.
* Arbitrary exceptions no longer silenced in constructors and comparisons.
* TypeError raised in the constructor contains now the name of the type.
* Accept only ChannelID and int-like objects in channel functions.
* Accept only InterpreterId, int-like objects and str in the InterpreterId constructor.
* Accept int-like objects, not just int in interpreter related functions.
(cherry picked from commit bf169915ecdd42329726104278eb723a7dda2736)

5 years ago[3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH...
Serhiy Storchaka [Sat, 14 Sep 2019 10:31:50 +0000 (13:31 +0300)]
[3.8] bpo-37206: Unrepresentable default values no longer represented as None. (GH-13933) (GH-16141)

In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values
(like in the optional third parameter of getattr). "None" should be used if None is accepted
as argument and passing None has the same effect as not passing the argument at all.
(cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years agobpo-37953: Fix deprecation warnings in test_typing (GH-16133)
Miss Islington (bot) [Sat, 14 Sep 2019 08:02:19 +0000 (01:02 -0700)]
bpo-37953: Fix deprecation warnings in test_typing (GH-16133)

self.assertEquals() is deprecated.

```
./python -We -m test test_typing
Run tests sequentially
0:00:00 load avg: 0.23 [1/1] test_typing
test test_typing failed -- Traceback (most recent call last):
  File "/home/lubuntu2/cpython/Lib/test/test_typing.py", line 2382, in test_forward_equality_gth
    self.assertEquals(Union[c1, c1_gth], Union[c1])
  File "/home/lubuntu2/cpython/Lib/unittest/case.py", line 1390, in deprecated_func
    warnings.warn(
DeprecationWarning: Please use assertEqual instead.

test_typing failed

== Tests result: FAILURE ==

1 test failed:
    test_typing

Total duration: 140 ms
Tests result: FAILURE
```

https://bugs.python.org/issue37953
(cherry picked from commit d057b896f97e6d7447b9bf9246770c41cf205299)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years ago[3.8] Doc: Fix link to window.getch in curses documentation (GH-16132) (GH-16135)
Stéphane Wirtel [Sat, 14 Sep 2019 06:25:10 +0000 (07:25 +0100)]
[3.8] Doc: Fix link to window.getch in curses documentation (GH-16132) (GH-16135)

(cherry picked from commit a26ace19bddea2d7a999a6de8286b3f27b132f35)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
5 years agobpo-37953: Fix ForwardRef hash and equality checks (GH-15400)
Miss Islington (bot) [Fri, 13 Sep 2019 20:00:39 +0000 (13:00 -0700)]
bpo-37953: Fix ForwardRef hash and equality checks (GH-15400)

Ideally if we stick a ForwardRef in a dictionary we would like to reliably be able to get it out again.

https://bugs.python.org/issue37953
(cherry picked from commit e082e7cbe4a934b86f7a07354d97d4e14a9dd46a)

Co-authored-by: plokmijnuhby <39633434+plokmijnuhby@users.noreply.github.com>
5 years agoFix typo in test_api.py. (GH-16119)
Miss Islington (bot) [Fri, 13 Sep 2019 17:49:09 +0000 (10:49 -0700)]
Fix typo in test_api.py. (GH-16119)

(cherry picked from commit 0bc17ea2f5966f429b5b8d6b4ccb9c01f1f610d0)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agobpo-34706: Preserve subclassing in inspect.Signature.from_callable (GH-16108) (GH...
Miss Islington (bot) [Fri, 13 Sep 2019 17:42:35 +0000 (10:42 -0700)]
bpo-34706: Preserve subclassing in inspect.Signature.from_callable (GH-16108) (GH-16113)

https://bugs.python.org/issue34706

Specifically in the case of a class that does not override its
constructor signature inherited from object.

These are Buck Evan @bukzor's changes cherrypicked from GH-9344.
(cherry picked from commit 5b9ff7a0dcb16d6f5c3cd4f1f52e0ca6a4bde586)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
5 years agoDoc: fcntl.lockf() is more powerful than written (GH-6750)
Miss Islington (bot) [Fri, 13 Sep 2019 17:39:42 +0000 (10:39 -0700)]
Doc: fcntl.lockf() is more powerful than written (GH-6750)

(cherry picked from commit 77cd0ceab2f6c1696fb1d31115c2f880b2e21934)

Co-authored-by: Eric O. LEBIGOT (EOL) <lebigot@users.noreply.github.com>
5 years agobpo-32790: Add info about alt format using GH- for 'g' in chart (GH-6624)
Miss Islington (bot) [Fri, 13 Sep 2019 17:28:46 +0000 (10:28 -0700)]
bpo-32790: Add info about alt format using GH- for 'g' in chart (GH-6624)

(cherry picked from commit d44542f9a231bf725ecd82eb640a672c759a8227)

Co-authored-by: bchhabra2490 <bchhabra2490@gmail.com>
5 years ago[3.8] bpo-38150: Fix refleak in the finalizer of a _testcapimodule type (GH-16115...
Stéphane Wirtel [Fri, 13 Sep 2019 17:10:53 +0000 (18:10 +0100)]
[3.8] bpo-38150: Fix refleak in the finalizer of a _testcapimodule type (GH-16115) (GH-16118)

The PyLong created in the finalizer was not being cleaned up

https://bugs.python.org/issue38150

Automerge-Triggered-By: @matrixise
(cherry picked from commit a67ac2f2d9550e5a36d28f9b6eeacf6575dda2d5)

Co-authored-by: Eddie Elizondo <eelizondo@fb.com>
5 years agobpo-38092: Reduce overhead when using multiprocessing in a Windows virtual environmen...
Miss Islington (bot) [Fri, 13 Sep 2019 16:59:11 +0000 (09:59 -0700)]
bpo-38092: Reduce overhead when using multiprocessing in a Windows virtual environment (GH-16098)

https://bugs.python.org/issue38092
(cherry picked from commit f2b7556ef851ac85e7cbf189d1b29fdeb9539b88)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agobpo-37199: Replace the early returns added in c2cda63. (GH-14535)
Miss Islington (bot) [Fri, 13 Sep 2019 16:12:33 +0000 (09:12 -0700)]
bpo-37199: Replace the early returns added in c2cda63. (GH-14535)

(cherry picked from commit 81319a81b2a3f42fe1047c2e6f5fd958faab6cdb)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years agoRun autoreconf. (GH-16106)
Miss Islington (bot) [Fri, 13 Sep 2019 14:50:43 +0000 (07:50 -0700)]
Run autoreconf. (GH-16106)

(cherry picked from commit f3095b0b58ad9d59cf221bb6498f5aa673c0b25a)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agobpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)
Miss Islington (bot) [Fri, 13 Sep 2019 14:25:51 +0000 (07:25 -0700)]
bpo-25068: urllib.request.ProxyHandler now lowercases the dict keys (GH-13489)

(cherry picked from commit b761e3aed1fbada4572a776f6a0d3c4be491d595)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years agocloses bpo-36002: Use AC_PATH_TOOL to find llvm-profdata and llvm-ar. (GH-14998)
Miss Islington (bot) [Fri, 13 Sep 2019 13:57:45 +0000 (06:57 -0700)]
closes bpo-36002: Use AC_PATH_TOOL to find llvm-profdata and llvm-ar. (GH-14998)

(cherry picked from commit 0519d497b04b252f50dfff9101fb7f4b9e33f1c4)

Co-authored-by: Doyle Rowland <doyle.rowland@reliaqual.com>
5 years agobpo-26468: Doc: improve the documentation of shutil.copy2 when it can fail. (GH-13765)
Miss Islington (bot) [Fri, 13 Sep 2019 13:43:34 +0000 (06:43 -0700)]
bpo-26468: Doc: improve the documentation of shutil.copy2 when it can fail. (GH-13765)

(cherry picked from commit 9585f46b97931d2640c3343dfe03aed15beb9fea)

Co-authored-by: Windson yang <wiwindson@outlook.com>
5 years ago[3.8] bpo-38148: Add slots to asyncio transports (GH-16077) (GH-16093)
Andrew Svetlov [Fri, 13 Sep 2019 13:14:55 +0000 (16:14 +0300)]
[3.8] bpo-38148: Add slots to asyncio transports (GH-16077) (GH-16093)

* bpo-38148: Add slots to asyncio transports

* Update Misc/NEWS.d/next/Library/2019-09-13-08-55-43.bpo-38148.Lnww6D.rst

Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 9eb35ab0d71a6bd680e84fa0f828cb634e72b681)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
5 years agobpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095)
Miss Islington (bot) [Fri, 13 Sep 2019 13:14:42 +0000 (06:14 -0700)]
bpo-29986: Doc: Delete tip to raise TypeError from tp_richcompare. (GH-16095)

(cherry picked from commit 375a3e2bdbeb4dce69aba4b5bc90f55fe27e81b4)

Co-authored-by: Julien Palard <julien@palard.fr>
5 years agoDoc: Improve consistency of os.path.normcase with other os.path functions (GH-14004)
Miss Islington (bot) [Fri, 13 Sep 2019 13:07:48 +0000 (06:07 -0700)]
Doc: Improve consistency of os.path.normcase with other os.path functions (GH-14004)

(cherry picked from commit 53f78ec9e181f544b1a4575f32d42e296e05e4b4)

Co-authored-by: Kexuan Sun <me@kianasun.com>
5 years agobpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921)
Miss Islington (bot) [Fri, 13 Sep 2019 11:47:51 +0000 (04:47 -0700)]
bpo-12144: Handle cookies with expires attribute in CookieJar.make_cookies (GH-13921)

Handle time comparison for cookies with `expires` attribute when `CookieJar.make_cookies` is called.

Co-authored-by: Demian Brecht <demianbrecht@gmail.com>
https://bugs.python.org/issue12144

Automerge-Triggered-By: @asvetlov
(cherry picked from commit bb41147eab15a2958f4ad38261e5bf608f6ace1b)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
5 years agobpo-36889: Document Stream class and add docstrings (GH-14488)
Miss Islington (bot) [Fri, 13 Sep 2019 11:23:43 +0000 (04:23 -0700)]
bpo-36889: Document Stream class and add docstrings (GH-14488)

* This just copies the docs from `StreamWriter` and `StreamReader`.
* Add docstring for asyncio functions.

https://bugs.python.org/issue36889

Automerge-Triggered-By: @asvetlov
(cherry picked from commit d31b31516c71890e8735606aec1dbf2bfb8fd6be)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
5 years agoFix the ImportWarning regarding __spec__ and __package__ being None (GH-16003)
Miss Islington (bot) [Fri, 13 Sep 2019 10:53:22 +0000 (03:53 -0700)]
Fix the ImportWarning regarding __spec__ and __package__ being None (GH-16003)

(cherry picked from commit 6e1a30b15e73ebc82e6790495fd54cc8971723ec)

Co-authored-by: Xtreak <tir.karthi@gmail.com>
5 years agobpo-37785: Fix xgettext warning in argparse (GH-15161)
Miss Islington (bot) [Fri, 13 Sep 2019 09:45:27 +0000 (02:45 -0700)]
bpo-37785: Fix xgettext warning in argparse (GH-15161)

(cherry picked from commit 42671aea2db6cbc54369617da0fd3545048e0a45)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
5 years agobpo-38133: Allow py.exe launcher to locate installations from the Microsoft Store...
Miss Islington (bot) [Thu, 12 Sep 2019 17:36:14 +0000 (10:36 -0700)]
bpo-38133: Allow py.exe launcher to locate installations from the Microsoft Store (GH-16025)

(cherry picked from commit ed93a8852d120c5a3606720edc723bf5aa6a1fc2)

Co-authored-by: Steve Dower <steve.dower@python.org>
5 years agoEmphasize the need to always call PySequence_Fast. (GH-11140)
Miss Islington (bot) [Thu, 12 Sep 2019 16:26:17 +0000 (09:26 -0700)]
Emphasize the need to always call PySequence_Fast. (GH-11140)

(cherry picked from commit 57b7dbc46e71269d855e644d30826d33eedee2a1)

Co-authored-by: Matti Picus <matti.picus@gmail.com>
5 years agocloses bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)
Miss Islington (bot) [Thu, 12 Sep 2019 16:05:52 +0000 (09:05 -0700)]
closes bpo-37803: pdb: fix handling of options (--help / --version) (GH-15193)

The "--" should not be included with long options passed to
getopt.getopt.

Fixes https://bugs.python.org/issue37803
(cherry picked from commit 855df7f273c3988c72f01e51ba57091887ec38b2)

Co-authored-by: Daniel Hahler <github@thequod.de>
5 years agobpo-37908: Add an example of ArgumentParser.exit() (GH-15455)
Miss Islington (bot) [Thu, 12 Sep 2019 15:43:14 +0000 (08:43 -0700)]
bpo-37908: Add an example of ArgumentParser.exit() (GH-15455)

Co-Authored-By: Brandt Bucher <brandtbucher@gmail.com>
(cherry picked from commit b1a2abdb06408ffc4f13d6ff50351ad49c99afc0)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
5 years ago[3.8] bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993) (GH-16064)
Jason R. Coombs [Thu, 12 Sep 2019 15:41:31 +0000 (16:41 +0100)]
[3.8] bpo-38121: Sync importlib.metadata with 0.22 backport (GH-15993) (GH-16064)

* bpo-38121: Sync importlib.metadata with 0.22 backport

* 📜🤖 Added by blurb_it..
(cherry picked from commit 8ed6503eca4e3ea4949479d8d7fd9ffd54f81038)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
5 years agobpo-38096: Complete the "structseq" and "named tuple" cleanup (GH-16010) (GH-16062)
Miss Islington (bot) [Thu, 12 Sep 2019 15:20:31 +0000 (08:20 -0700)]
bpo-38096:  Complete the "structseq" and "named tuple" cleanup (GH-16010) (GH-16062)

(cherry picked from commit 4210ad5ebd5769f585035e022876e161cd0e9a3e)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
5 years agobpo-37935: Added tests for os.walk(), glob.iglob() and Path.glob() (GH-15956) (GH...
Miss Islington (bot) [Thu, 12 Sep 2019 15:07:47 +0000 (08:07 -0700)]
bpo-37935: Added tests for os.walk(), glob.iglob() and Path.glob() (GH-15956) (GH-16043)

Test that they do not keep too many file descriptors open for the host OS in a reasonable test scenario.

See [bpo-37935](https://bugs.python.org/issue37935).
(cherry picked from commit f9dc2ad89032201427ed5f08061c703794627ad9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
5 years ago[3.8] bpo-38137: Re-add OpenSSL 1.0.2 compat (GH-16051) (GH-16057)
Stéphane Wirtel [Thu, 12 Sep 2019 14:57:03 +0000 (15:57 +0100)]
[3.8] bpo-38137: Re-add OpenSSL 1.0.2 compat (GH-16051) (GH-16057)

The defines are required for OpenSSL 1.0.2 and LibreSSL.

https://bugs.python.org/issue38134

Automerge-Triggered-By: @tiran
(cherry picked from commit 9a4963b932a087b78596cca0b8394ac898faa490)

Co-authored-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue38137

Automerge-Triggered-By: @matrixise
5 years agobpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() (GH-15773)
Miss Islington (bot) [Thu, 12 Sep 2019 14:55:48 +0000 (07:55 -0700)]
bpo-37488 : Document a warning for datetime.utcnow() and utcfromtimestamp() (GH-15773)

https://bugs.python.org/issue37488

Automerge-Triggered-By: @pganssle
(cherry picked from commit 1a53c785e62e00bad87ae19466c3a32ebcebb915)

Co-authored-by: Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com>
5 years agobpo-21872: fix lzma library decompresses data incompletely (GH-14048)
Miss Islington (bot) [Thu, 12 Sep 2019 14:41:11 +0000 (07:41 -0700)]
bpo-21872: fix lzma library decompresses data incompletely (GH-14048)

* 1. add test case with wrong behavior
* 2. fix bug when max_length == -1
* 3. allow b"" as valid input data for decompress_buf()
* 4. when max_length >= 0, let needs_input mechanism works
* add more asserts to test case
(cherry picked from commit 4ffd05d7ec47cfd0d7fc95dce851633be9663255)

Co-authored-by: animalize <animalize@users.noreply.github.com>
5 years agoOverhaul datetime documentation (GH-13410)
Miss Islington (bot) [Thu, 12 Sep 2019 14:37:36 +0000 (07:37 -0700)]
Overhaul datetime documentation (GH-13410)

This is a restructuring of the datetime documentation to hopefully make
them more user-friendly and approachable to new users without losing any
of the detail.

Changes include:
 - Creating dedicated subsections for some concepts such as:
    - "Constants"
    - "Naive vs Aware"
    - "Determining if an Object is Aware"
 - Give 'naive vs aware' its own subsection
 - Give 'constants' their own subsection
 - Overhauling the strftime-strptime section by:
    - Breaking it into logical, linkable, and digestable parts
    - Adding a high-level comparison table
    - Moving the technical detail to bottom: readers come to this
      section primarily to remind themselves to things:
      - How do I write the format code for X?
      - strptime/strftime: which one is which again?
 - Touching up fromisoformat + isoformat sections by:
    - Revising fromisoformat + isoformat for date, time, and
      datetime
    - Adding basic examples
    - Enforcing consistency about putting formats (i.e. ``HH:MM``)
      in double backticks.  This was previously done in some places
      but not all
    - Putting long 'supported formats', on their own line to improve
      readability
 - Moving the 'seealso' section to the top and add a link to dateutil
    Rationale: This doesn't really belong nested under the
    'constants' section.  Let readers know right away that
    datetime is one of several related tools.
 - Moving common features of several types into one place:
    Previously, each type went out of its way to note separately
    that it was hashable and picklable.  These can be brought
    into one single place that is more prominent.
 - Reducing some verbose explanations to improve readability
 - Breaking up long paragraphs into digestable chunks
 - Displaying longer "equivalent to" examples, as short code blocks
 - Using the dot notation for datetime/time classes:
    Use :class:`.time` and :class:`.datetime` rather than :class:`time` and
    :class:`datetime`; otherwise, the generated links will route to the
    respective modules, not classes.
 - Rewording the tzinfo class description
    The top paragraph should get straight to the point of telling the reader
    what subclasses of tzinfo _do_.  Previously, that was hidden in a later
    paragraph.
 - Adding a note on .today() versus .now()
 - Rearranging and expanding example blocks, including:
    - Moved long, multiline inline examples to standalone examples
    - Simplified the example block for timedelta arithmetic:
        - Broke the example into two logical sections:
          1. normalization/parameter 'merging'
          2. timedelta arithmetic
        - Reduced the complexity of the some of the examples.  Show
          reasonable, real-world uses cases that are easy to follow
          along with and progres in difficult slightly.
    - Broke up the example sections for date and datetime sections by putting
      the easy examples first, progressing to more esoteric situations and
      breaking it up into logical sections based on what the methods are
      doing at a high level.
    - Simplified the KabulTz example:
        - Put the class definition itself into a non-REPL block since there is
          no interactive output involved there
        - Briefly explained what's happening before launching into the code
        - Broke the example section into visually separate chunks
 - Various whitespace, formatting, style and grammar fixes including:
    - Consistently using backctics for 'date_string' formats
    - Consistently using one space after periods.
    - Consistently using bold for vocab terms
    - Consistently using italics when referring to params:
      See https://devguide.python.org/documenting/GH-id4
    - Using '::' to lead into code blocks
        Per https://devguide.python.org/documenting/GH-source-code, this will
        let the reader use the 'expand/collapse' top-right button for REPL
        blocks to hide or show the prompt.
    - Using consistent captialization schemes
    - Removing use of the default role
    - Put 'example' blocks in Markdown subsections

This is a combination of 66 commits.

See bpo-36960: https://bugs.python.org/issue36960
(cherry picked from commit 3fb1363fe87a24cdb2ee1dd9746f1c49046af958)

Co-authored-by: Brad <brad.solomon.1124@gmail.com>
5 years agobpo-36991: Fix incorrect exception escaping ZipFile.extract() (GH-13632)
Miss Islington (bot) [Thu, 12 Sep 2019 14:33:53 +0000 (07:33 -0700)]
bpo-36991: Fix incorrect exception escaping ZipFile.extract() (GH-13632)

(cherry picked from commit 2f1b857562b0f1601c9019db74c29b7d7e21ac9f)

Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
5 years agobpo-38132: Check EVP_DigestUpdate for error (GH-16041)
Miss Islington (bot) [Thu, 12 Sep 2019 13:50:46 +0000 (06:50 -0700)]
bpo-38132: Check EVP_DigestUpdate for error (GH-16041)

(cherry picked from commit 8c74574e0aaf1a00719fbc9acbdc27a3923520aa)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-37363: Document internal audit events (GH-14663)
Miss Islington (bot) [Thu, 12 Sep 2019 13:20:26 +0000 (06:20 -0700)]
bpo-37363: Document internal audit events (GH-14663)

Three internal cpython events were not documented, yet.

Signed-off-by: Christian Heimes <christian@python.org>
https://bugs.python.org/issue37363
(cherry picked from commit ed4b3216e59df4806e5ef63b3357fc577a9443d7)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-38132: Simplify _hashopenssl code (GH-16023) (#16040)
Miss Islington (bot) [Thu, 12 Sep 2019 13:03:50 +0000 (06:03 -0700)]
bpo-38132: Simplify _hashopenssl code (GH-16023) (#16040)

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

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)
Miss Islington (bot) [Thu, 12 Sep 2019 12:59:50 +0000 (05:59 -0700)]
bpo-36373: Deprecate explicit loop in task and subprocess API (GH-16033)

(cherry picked from commit a488879cbaf4b8b52699cadccf73bb4c271bcb29)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
5 years agobpo-26868: Fix example usage of PyModule_AddObject. (GH-15725)
Miss Islington (bot) [Thu, 12 Sep 2019 12:26:46 +0000 (05:26 -0700)]
bpo-26868: Fix example usage of PyModule_AddObject. (GH-15725)

* Add a note to the PyModule_AddObject docs.

* Correct example usages of PyModule_AddObject.

* Whitespace.

* Clean up wording.

* 📜🤖 Added by blurb_it.

* First code review.

* Add < 0 in the tests with PyModule_AddObject
(cherry picked from commit 224b8aaa7e8f67f748e8b7b6a4a77a25f6554651)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
5 years agobpo-35325: Doc: imp.find_module() return value documentation discrepancy (GH-11040)
Miss Islington (bot) [Thu, 12 Sep 2019 12:25:54 +0000 (05:25 -0700)]
bpo-35325: Doc: imp.find_module() return value documentation discrepancy (GH-11040)

(cherry picked from commit 967b84c913c7b09ae2fc86272cb9373415e2beaf)

Co-authored-by: Windson yang <wiwindson@outlook.com>
5 years agobpo-38134: Remove PKBDF2_HMAC_fast from _hashopenssl (GH-16028)
Miss Islington (bot) [Thu, 12 Sep 2019 12:18:38 +0000 (05:18 -0700)]
bpo-38134: Remove PKBDF2_HMAC_fast from _hashopenssl (GH-16028)

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

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)
Miss Islington (bot) [Thu, 12 Sep 2019 11:37:05 +0000 (04:37 -0700)]
bpo-35685: Add examples of unittest.mock.patch.dict usage (GH-11456)

(cherry picked from commit 31a82e25b6044a5b5ee25246bad3eb7b873cf5ec)

Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
5 years agobpo-36675: Remove obsolete code. (GH-16024)
Miss Islington (bot) [Thu, 12 Sep 2019 11:31:17 +0000 (04:31 -0700)]
bpo-36675: Remove obsolete code. (GH-16024)

Does no longer work since Sphinx moved the trim_doctest_flag option in
the configuration.
(cherry picked from commit 2c910c1e732c9a3ec4c67a7c43d789d6c729304a)

Co-authored-by: Julien Palard <julien@palard.fr>
5 years ago[3.8] bpo-32008: Prefer client or TLSv1_2 in examples (GH-5797) (GH-16027)
Stéphane Wirtel [Thu, 12 Sep 2019 11:25:02 +0000 (12:25 +0100)]
[3.8] bpo-32008: Prefer client or TLSv1_2 in examples (GH-5797) (GH-16027)

Prefer client or TLSv1_2 in examples

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

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)
Miss Islington (bot) [Thu, 12 Sep 2019 11:19:21 +0000 (04:19 -0700)]
bpo-38110: Use fdwalk for os.closerange() when available. (GH-15224)

Use fdwalk() on platforms that support it to implement os.closerange().
(cherry picked from commit e20134f889a0cfcc37a46979f31a1c98b800de07)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
5 years agobpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining...
Miss Islington (bot) [Thu, 12 Sep 2019 10:52:49 +0000 (03:52 -0700)]
bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable (GH-15565) (GH-15965)

* bpo-37972: unittest.mock._Call now passes on __getitem__ to the __getattr__ chaining so that call() can be subscriptable

* 📜🤖 Added by blurb_it.

* Update 2019-08-28-21-40-12.bpo-37972.kP-n4L.rst

added name of the contributor

* bpo-37972: made all dunder methods chainable for _Call

* bpo-37972: delegate only attributes of tuple instead to __getattr__
(cherry picked from commit 72c359912d36705a94fca8b63d80451905a14ae4)

Co-authored-by: blhsing <github@ydooby.com>
5 years agocloses bpo-37405: Make socket.getsockname() always return a tuple for AF_CAN. (GH...
Miss Islington (bot) [Thu, 12 Sep 2019 10:34:28 +0000 (03:34 -0700)]
closes bpo-37405: Make socket.getsockname() always return a tuple for AF_CAN. (GH-14392) (GH-16018)

This fixes a regression from 3.5. In recent releases, `getsockname()` in the AF_CAN case has returned a string.
(cherry picked from commit 954900a3f98a8c0dea14dd575490237f3f8626b3)

Co-authored-by: bggardner <brent@ebrent.net>
5 years agobpo-38008: Move builtin protocol whitelist to mapping instead of list (GH-15647)
Miss Islington (bot) [Thu, 12 Sep 2019 10:32:36 +0000 (03:32 -0700)]
bpo-38008: Move builtin protocol whitelist to mapping instead of list (GH-15647)

Fixes https://bugs.python.org/issue38008
(cherry picked from commit 692a0dc91597b7fb350383b633dc4d044cbd360e)

Co-authored-by: Divij Rajkumar <drajkuma1@gmail.com>
5 years agobpo-13927: time.ctime and time.asctime return string explantion (GH-11303)
Miss Islington (bot) [Thu, 12 Sep 2019 10:31:43 +0000 (03:31 -0700)]
bpo-13927: time.ctime and time.asctime return string explantion (GH-11303)

* bpo-13927: time.ctime and time.asctime return string explantion

* Add note explaining that time.ctime and time.asctime returns a space padded date value in case it contains a single digit date

* Reformat linebreaks
(cherry picked from commit 2d32bf1ef23c9e468b2e8afab3c24e7a2047ac36)

Co-authored-by: Harmandeep Singh <harmandeep.singh1@delhivery.com>
5 years agocloses bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. ...
Miss Islington (bot) [Thu, 12 Sep 2019 10:28:05 +0000 (03:28 -0700)]
closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)

An exception may occur during a PyObject_IsSubclass() call.
(cherry picked from commit ea683deccc505a78bbbb1eb8c6a88b0835ad5151)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
5 years ago[3.8] bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type...
Petr Viktorin [Thu, 12 Sep 2019 09:44:46 +0000 (10:44 +0100)]
[3.8] bpo-37879: Suppress subtype_dealloc decref when base type is a C heap type (GH-15323, GH-16004) (GH-15966)

The instance destructor for a type is responsible for preparing
an instance for deallocation by decrementing the reference counts
of its referents.

If an instance belongs to a heap type, the type object of an instance
has its reference count decremented while for static types, which
are permanently allocated, the type object is unaffected by the
instance destructor.

Previously, the default instance destructor searched the class
hierarchy for an inherited instance destructor and, if present,
would invoke it.

Then, if the instance type is a heap type, it would decrement the
reference count of that heap type.  However, this could result in the
premature destruction of a type because the inherited instance
destructor should have already decremented the reference count
of the type object.

This change avoids the premature destruction of the type object
by suppressing the decrement of its reference count when an
inherited, non-default instance destructor has been invoked.

Finally, an assertion on the Py_SIZE of a type was deleted.  Heap
types have a non zero size, making this into an incorrect assertion.

https://github.com/python/cpython/pull/15323.
(cherry picked from commit ff023ed36ea260ab64be5895f1f1f087c798987a)
Fixup: https://github.com/python/cpython/pull/16004.
(cherry picked from commit 5e9caeec76119a0d61c25f1466c27b7dbd5115bd)

Co-authored-by: Eddie Elizondo <eduardo.elizondorueda@gmail.com>
5 years agoDoc: Update pickle.rst (GH-14128) (GH-16014)
Miss Islington (bot) [Thu, 12 Sep 2019 08:19:12 +0000 (01:19 -0700)]
Doc: Update pickle.rst (GH-14128) (GH-16014)

* Edits for readability and grammar
(cherry picked from commit 362f5350eb5e2c7bfb0b0a8c306a2e128c3aee93)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
5 years agobpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) (GH-15961)
Paul Ganssle [Thu, 12 Sep 2019 02:50:29 +0000 (03:50 +0100)]
bpo-38096: Clean up the "struct sequence" / "named tuple" docs (GH-15895) (GH-15961)

5 years agocloses bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)
Miss Islington (bot) [Thu, 12 Sep 2019 00:04:27 +0000 (17:04 -0700)]
closes bpo-38124: Fix bounds check in PyState_AddModule. (GH-16007)

The >=, checking whether a module index was in already in the module-by-index list, needed to be strict.

Also, fold nested ifs into one and fix some bad spacing.
(cherry picked from commit 39de95b746c990e6a2fe9af5fad01747f58b2e5f)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
5 years agoCorrect typo in min version test (GH-16001)
Miss Islington (bot) [Wed, 11 Sep 2019 18:19:12 +0000 (11:19 -0700)]
Correct typo in min version test (GH-16001)

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

Co-authored-by: Christian Heimes <christian@python.org>
5 years agobpo-36270: Doc: add link to traceback object reference (GH-13119)
Miss Islington (bot) [Wed, 11 Sep 2019 18:12:35 +0000 (11:12 -0700)]
bpo-36270: Doc: add link to traceback object reference (GH-13119)

(cherry picked from commit 9936371af298d465095ae70bc9c2943b4b16eac4)

Co-authored-by: Björn Meier <bjoern@opentrash.org>
5 years agobpo-34001: Fix test_ssl with LibreSSL (GH-13783) (#15997)
Miss Islington (bot) [Wed, 11 Sep 2019 17:59:13 +0000 (10:59 -0700)]
bpo-34001: Fix test_ssl with LibreSSL (GH-13783) (#15997)

(cherry picked from commit c9bc49c5f6e26a7c958307c2ac338951a7534d9a)

Co-authored-by: Christian Heimes <christian@python.org>
5 years agoImprove clarity of try-return-finally-return (GH-15677) (GH-15981)
Miss Islington (bot) [Wed, 11 Sep 2019 17:42:21 +0000 (10:42 -0700)]
Improve clarity of try-return-finally-return (GH-15677) (GH-15981)

Clarify execution in try-return-finally-return case.
(cherry picked from commit 0cc27417f2cd399c432d7dda9aeca1d81af76936)

Co-authored-by: toonarmycaptain <toonarmycaptain@hotmail.com>
5 years ago[3.8] bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992) (GH-15999)
Stéphane Wirtel [Wed, 11 Sep 2019 17:36:00 +0000 (19:36 +0200)]
[3.8] bpo-37698: Update doc of PyBuffer_ToContiguous (GH-14992) (GH-15999)

https://bugs.python.org/issue37698
(cherry picked from commit 15f5a7527b87e11fcf23069c147fd4cb7d42cfb0)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
5 years agoDoc: recursive glob ** follows symlinks to directories (GH-12918)
Miss Islington (bot) [Wed, 11 Sep 2019 17:32:26 +0000 (10:32 -0700)]
Doc: recursive glob ** follows symlinks to directories (GH-12918)

(cherry picked from commit e24594bfe75aff3e654665cb940ddc4d4acffd2f)

Co-authored-by: Marc <Marc.Herbert+github@gmail.com>
5 years agobpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15990)
Miss Islington (bot) [Wed, 11 Sep 2019 17:09:57 +0000 (10:09 -0700)]
bpo-37750: Add doc of PyBuffer_FromContiguous (GH-15988) (GH-15990)

https://bugs.python.org/issue37750

Automerge-Triggered-By: @matrixise
(cherry picked from commit 5a56ce4a0e820fefcd598b94715a7ff7e199858d)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
5 years agobpo-38117: Test with OpenSSL 1.1.1d (GH-15983)
Miss Islington (bot) [Wed, 11 Sep 2019 17:09:28 +0000 (10:09 -0700)]
bpo-38117: Test with OpenSSL 1.1.1d (GH-15983)

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

Co-authored-by: Christian Heimes <christian@python.org>