Commit Graph

108128 Commits

Author SHA1 Message Date
Miss Islington (bot) 5a6b5d8c39
bpo-42727: Fix the NEWS entry .rst (GH-23932)
It was causing CI failures.  the offending file came from https://github.com/python/cpython/pull/23917

```
python3 tools/rstlint.py ../Misc/NEWS.d/next/
[2] ../Misc/NEWS.d/next/Library/2020-12-23-19-43-06.bpo-42727.WH3ODh.rst:1: default role used
[2] ../Misc/NEWS.d/next/Library/2020-12-23-19-43-06.bpo-42727.WH3ODh.rst:2: default role used
2 problems with severity 2 found.
Makefile:204: recipe for target 'check' failed
```
(cherry picked from commit 8badadec53)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-12-24 20:53:27 -08:00
Ethan Furman f7dca9b9c8
[3.9] bpo-42727: [Enum] EnumMeta.__prepare__ now accepts **kwds (GH-23917). (GH-23926)
* [3.9] [Enum] EnumMeta.__prepare__ now accepts **kwds (GH-23917).
(cherry picked from commit 6ec0adefad)
2020-12-24 12:02:38 -08:00
Miss Islington (bot) 3bb85672bb
closes bpo-42726: gdb libpython: InstanceProxy support for py3 (GH-23912)
On Fedora 31 gdb is using python 3.7.9, calling `proxyval` on an instance with a dictionary fails because of the `dict.iteritems` usage. This PR changes the code to be compatible with py2 and py3.

This changed seemed small enough to not need an issue and news blurb, if one is required please let me know.

Automerge-Triggered-By: GH:benjaminp
(cherry picked from commit b57ada98da)

Co-authored-by: Augusto Hack <hack.augusto@gmail.com>
2020-12-24 09:37:07 -08:00
Miss Islington (bot) a1251980d2
bpo-42195: Override _CallableGenericAlias's __getitem__ (GH-23915)
Added `__getitem__` for `_CallableGenericAlias` so that it returns a subclass (itself) of `types.GenericAlias` rather than the default behavior of returning a plain `types.GenericAlias`. This fixes `repr` issues occuring after `TypeVar` substitution arising from the previous behavior.
(cherry picked from commit 6dd3da3cf4)

Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
2020-12-23 19:07:51 -08:00
Miss Islington (bot) 1e1bacf9e6
BPO-42703: Fix incorrect documentation links for asyncio.Event (GH-23881)
(cherry picked from commit d90ff37681)

Co-authored-by: Matt Fowler <matt.fow@gmail.com>
2020-12-23 03:13:51 -08:00
Miss Islington (bot) 7fe7d83c26
bpo-42620: Improve socket.getsockname doc string (GH-23742)
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit cf3565ca9a)

Co-authored-by: Christian Heimes <christian@python.org>
2020-12-22 23:48:04 -08:00
Miss Islington (bot) 8e5c61a075
bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors without a lineno (GH-23427)
(cherry picked from commit 069560b117)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2020-12-22 14:12:30 -08:00
Miss Islington (bot) 4ec2149708
bpo-29030: Document interaction between *choices* and *metavar*. (GH-23884) (GH-23894) 2020-12-22 10:19:24 -08:00
Andre Delfino 7c48859eeb
[3.9] [doc] Fix a few margins due to bad markup (GH-23619). (GH-23859)
(cherry picked from commit 96a09df644)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-12-21 18:53:50 -08:00
Andre Delfino e89993cff4
[3.9] [doc] Fix erroneous backslashes in signatures and names (GH-23658) (GH-23827)
The issue being resolved is shown in the 3.10 docs (if you select docs for older versions you won't see a visual glitch).

The newer sphinx version that produces the 3.10 docs doesn't treat the backslash to escape things in some situations it previously did..
(cherry picked from commit dcc997cd28)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-12-21 18:52:19 -08:00
Miss Islington (bot) b4b323ce1a
Fix typo in docstring (GH-23515)
(cherry picked from commit 711381dfb0)

Co-authored-by: Fernando Toledo <42938011+fernandohtr@users.noreply.github.com>
2020-12-21 06:29:57 -08:00
Miss Islington (bot) 409ce4a09e
bpo-42669: Document that `except` rejects nested tuples (GH-23822) (GH-23870)
In Python 2, it was possible to use `except` with a nested tuple, and occasionally natural.  For example, `zope.formlib.interfaces.InputErrors` is a tuple of several exception classes, and one might reasonably think to do something like this:

    try:
        self.getInputValue()
        return True
    except (InputErrors, SomethingElse):
        return False

As of Python 3.0, this raises `TypeError: catching classes that do not inherit from BaseException is not allowed` instead: one must instead either break it up into multiple `except` clauses or flatten the tuple.  However, the reference documentation was never updated to match this new restriction.  Make it clear that the definition is no longer recursive.

Automerge-Triggered-By: GH:ericvsmith
(cherry picked from commit c95f8bc270)

Co-authored-by: Colin Watson <cjwatson@debian.org>

Co-authored-by: Colin Watson <cjwatson@debian.org>
2020-12-20 16:18:08 -05:00
Miss Islington (bot) 40b4c405f9
bpo-42572: Improve argparse docs for the type parameter. (GH-23849) (GH-23869) 2020-12-20 10:51:20 -08:00
Miss Islington (bot) 4b155967b3
bpo-42604: always set EXT_SUFFIX=${SOABI}${SHLIB_SUFFIX} when using configure (GH-23708) (GH-23866)
Now all platforms use a value for the "EXT_SUFFIX" build variable derived
from SOABI (for instance in FreeBSD, "EXT_SUFFIX" is now ".cpython-310d.so"
instead of ".so"). Previously only Linux, Mac and VxWorks were using a value
for "EXT_SUFFIX" that included "SOABI".

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
(cherry picked from commit a44ce6c9f7)

Co-authored-by: Matti Picus <matti.picus@gmail.com>

Co-authored-by: Matti Picus <matti.picus@gmail.com>
2020-12-20 04:54:18 +00:00
Miss Islington (bot) a34ab8188e
bpo-41724: Explain when the conversion is not possible with detect_types enabled (GH-23855) (GH-23862)
* Explain when the conversion is not possible with detect_types enabled
(cherry picked from commit 09a36cdfb7)

Co-authored-by: sblondon <sblondon@users.noreply.github.com>

Co-authored-by: sblondon <sblondon@users.noreply.github.com>
2020-12-19 19:02:25 -05:00
kj 597ebc8cf6
[3.9] bpo-42675: Document collections.abc.Callable changes (GH-23839) (#23852) 2020-12-19 14:32:06 -08:00
Miss Islington (bot) 6ad5fd1482
bpo-40219: Lowered ttk LabeledScale dummy (GH-21467) (GH-23788)
(cherry picked from commit b9ced83cf4)
2020-12-19 19:28:59 +02:00
Serhiy Storchaka 87e7a14ee3
[3.9] bpo-42630: Improve error reporting in Tkinter for absent default root (GH-23781) (GH-23853)
* Tkinter functions and constructors which need a default root window
  raise now RuntimeError with descriptive message instead of obscure
  AttributeError or NameError if it is not created yet or cannot
  be created automatically.

* Add tests for all functions which use default root window.

* Fix import in the pynche script.

(cherry picked from commit 3d569fd6dc)
2020-12-19 13:08:07 +02:00
Miss Islington (bot) d458d8dab0
bpo-42559: Not that getrandbits() is non-negative. (GH-23843) (GH-23851) 2020-12-18 19:10:06 -08:00
Miss Islington (bot) 782665885c
bpo-34805: Guarantee that __subclasses__() is in definition order. (GH-23844) (GH-23850) 2020-12-18 17:17:32 -08:00
Miss Islington (bot) eef33e6d49
bpo-42670: Fix a missing word in the itertools.product() docs (GH-23823) (GH-23824) 2020-12-18 16:55:52 -08:00
Miss Islington (bot) 4b412e830d
bpo-36769: Document that fnmatch.filter supports any kind of iterable (GH-13039)
(cherry picked from commit e8d2264210)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-12-18 11:34:27 -08:00
Miss Islington (bot) 82dbfd5a04
bpo-41891: ensure asyncio.wait_for waits for task completion (GH-22461) (#23840)
(cherry picked from commit 17ef4319a3)

Co-authored-by: Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com>

Co-authored-by: Richard Kojedzinszky <rkojedzinszky@users.noreply.github.com>
2020-12-18 11:19:10 -08:00
Miss Islington (bot) 14619924c3
bpo-17140: Document multiprocessing's ThreadPool (GH-23812)
Up until now, the `multiprocessing.pool.ThreadPool` class has gone
undocumented, despite being a public class in multiprocessing that is
included in `multiprocessing.pool.__all__`.
(cherry picked from commit 84ebcf271a)

Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
2020-12-18 05:27:02 -08:00
Miss Islington (bot) b812e236df
bpo-39096: Format specification documentation fixes for numeric types (GH-23575)
(cherry picked from commit 886b2e5c7a)

Co-authored-by: Mark Dickinson <mdickinson@enthought.com>
2020-12-18 01:49:19 -08:00
Miss Islington (bot) 79c535796d
bpo-42613: Fix freeze.py config directory (GH-23792) (GH-23817)
Fix freeze.py tool to use the prope config and library directories.
(cherry picked from commit 1c653f17cb)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-12-17 15:29:36 +01:00
Miss Islington (bot) 1c70d40e94
bpo-26564: fix obsolete comment in traceback.c (GH-23819)
(cherry picked from commit 40125ab325)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2020-12-17 05:19:58 -08:00
Miss Islington (bot) 8d0a01c99b
bpo-42375: subprocess DragonFlyBSD build update. (GH-23320) (GH-23388)
Same as FreeBSD, file descriptors in /dev/fd id from 0 to 63.
(cherry picked from commit 13b865f0e1)

Co-authored-by: David CARLIER <devnexen@gmail.com>

Co-authored-by: David CARLIER <devnexen@gmail.com>
2020-12-17 12:15:20 +01:00
Miss Islington (bot) e962e3ad22
bpo-41804: Enhance test_epoll.test_control_and_wait() (GH-23795)
Use shorter timeout and replace send() with sendall().
(cherry picked from commit 79782fe4f8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-12-17 00:03:50 -08:00
Miss Islington (bot) 2fba8445a4
Fix indentation for get_stats_profile() docs (GH-23618)
The existing method is indented one too many times which
makes it look like a sub-method of print_callees().
(cherry picked from commit a6ba2b9015)

Co-authored-by: Matthew Suozzo <msuozzo@google.com>
2020-12-17 01:18:39 +02:00
Miss Islington (bot) 78062e07bc
bpo-37961: Fix regression in tracemalloc.Traceback.__repr__ (GH-23805)
Regression in 8d59eb1b66.
(cherry picked from commit 051b981867)

Co-authored-by: Daniel Hahler <git@thequod.de>
2020-12-16 14:01:14 -08:00
Victor Stinner 1662868490
Add symbols of the stable ABI to python3dll.c (GH-23598) (GH-23801)
Add the following symbols to python3dll.c:

* PyFrame_GetCode (bpo-40421)
* PyFrame_GetLineNumber (bpo-40421)
* PyObject_CallNoArgs (bpo-37194)
* PyThreadState_GetFrame (bpo-39947)
* PyThreadState_GetID (bpo-39947)
* PyThreadState_GetInterpreter (bpo-39947)

(cherry picked from commit fcc6935384)
2020-12-16 22:41:47 +01:00
Miss Islington (bot) bf0eed3e60
bpo-38323: Add guard clauses in MultiLoopChildWatcher. (GH-22756)
This is a trivial refactor in preparation for a fix for bpo-38323.
(cherry picked from commit 66d3b589c4)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-12-16 10:10:37 -08:00
Miss Islington (bot) 9d409d6b47
bpo-39101: Fixes BaseException hang in IsolatedAsyncioTestCase. (GH-22654)
(cherry picked from commit 8374d2ee15)

Co-authored-by: Lisa Roach <lisaroach14@gmail.com>
2020-12-16 09:56:10 -08:00
Miss Islington (bot) 7492b55ea0
bpo-40686: Fix compiler warnings on _zoneinfo.c (GH-23614) (GH-23804)
"uint8_t day" is unsigned and so "day < 0" test is always true.
Remove the test to fix the following warnings on Windows:

modules\_zoneinfo.c(1224): warning C4068: unknown pragma
modules\_zoneinfo.c(1225): warning C4068: unknown pragma
modules\_zoneinfo.c(1227): warning C4068: unknown pragma
(cherry picked from commit aefb69b23f)

Co-authored-by: Victor Stinner <vstinner@python.org>

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-12-16 17:33:05 +01:00
Miss Islington (bot) cd7412e3c4
bpo-19733: Re-enable tests for -image option in Tkinter (GH-23785)
(cherry picked from commit 5f0fe8ec70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-12-16 02:54:04 -08:00
Miss Islington (bot) db63da7e5d
bpo-42644: Validate values in logging.disable() (GH-23786)
* bpo-42644: Validate values in logging.disable()

Technically make the value of manager a property that checks and convert
values assigned to it properly. This has the side effect of making
`logging.disable` also accept strings representing the various level of
warnings.

We want to validate the type of the disable attribute at assignment
time, as it is later compared to other levels when emitting warnings and
would generate a `TypeError: '>=' not supported between ....` in a
different part of the code base, which can make it difficult to track
down.

When assigned an incorrect value; it will raise a TypeError when the
wrong type, or ValueError if an invalid str.

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit b32d8b4f9b)

Co-authored-by: Matthias Bussonnier <bussonniermatthias@gmail.com>
2020-12-16 02:12:08 -08:00
Serhiy Storchaka 28bf6ab61f
[3.9] bpo-42318: Fix support of non-BMP characters in Tkinter on macOS (GH-23281). (GH-23784)
(cherry picked from commit a26215db11)
2020-12-15 20:44:44 +02:00
Miss Islington (bot) 99d37a0ee8
bpo-33610: Edit idlelib.codecontext (GH-23773) (GH-23775)
Add sentence to module docstring and import tkinter items.
(cherry picked from commit 6f79e60b66)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-12-15 07:51:56 -05:00
Ethan Furman 9d1fff1fcd
[3.9] bpo-42567: [Enum] call __init_subclass__ after members are added (GH-23714) (GH-23772)
When creating an Enum, `type.__new__` calls `__init_subclass__`, but at that point the members have not been added.

This patch suppresses the initial call, then manually calls the ancestor `__init_subclass__` before returning the new Enum class.
(cherry picked from commit 6bd94de168)
2020-12-14 18:41:34 -08:00
Miss Islington (bot) aba12b67c1
[3.9] bpo-42517: [Enum] deprecate private name members (GH-23722) (GH-23748)
private names will raise a DeprecationWarning; in 3.10 they will become normal attributes
2020-12-14 15:56:58 -08:00
Victor Stinner 6b2ed38509
bpo-42591: Export missing Py_FrozenMain() symbol (GH-23730) (GH-23734)
Export the Py_FrozenMain() function: fix a Python 3.9.0 regression.
Python 3.9 uses -fvisibility=hidden and the function was not exported
explicitly and so not exported.

(cherry picked from commit b5c7b38f5e)
2020-12-15 00:31:54 +01:00
Miss Islington (bot) 33cbb04986
bpo-40084: Enum - dir() includes member attributes (GH-19219)
(cherry picked from commit 68526fe258)

Co-authored-by: Angelin BOOZ <9497359+lem2clide@users.noreply.github.com>
2020-12-14 14:43:43 -08:00
Miss Islington (bot) dbb00062dc
bpo-42059: Fix required/optional keys for TypedDict(..., total=False) (GH-22736) (GH-23747)
(cherry picked from commit 67b769f515)

Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
2020-12-14 14:33:27 -08:00
Miss Islington (bot) 20bc40ef44
bpo-36541: Add lib2to3 grammar PEP-570 pos-only arg parsing (GH-23759)
Add positional only args support to lib2to3 pgen2.

This adds 3.8's PEP-570 support to lib2to3's pgen2.  lib2to3, while
being deprecated is still used by things to parse all versions of Python
code today.  We need it to support parsing modern 3.8 and 3.9 constructs.

Also add tests for complex *expr and **expr's.
(cherry picked from commit 42c9f0fd0a)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2020-12-14 09:38:03 -08:00
kj 33b3fedd43
[3.9] bpo-42195: Ensure consistency of Callable's __args__ in collections.abc and typing (GH-23765)
Backport of GH-23060.
2020-12-14 08:30:45 -08:00
Karthikeyan Singaravelan 14f2a124e2
[3.9] bpo-42532: Check if NonCallableMock's spec_arg is not None instead of call its __bool__ function (GH-23613) (GH-23676)
Check if NonCallableMock's spec_arg is not None instead of call its __bool__ function
(cherry picked from commit c598a04dd2)

Co-authored-by: idanw206 <31290383+idanw206@users.noreply.github.com>
2020-12-14 11:19:16 +05:30
Miss Islington (bot) 3dcdbdeb48
bpo-42598: Fix implicit function declarations in configure (GH-23690) (GH-23756)
This is invalid in C99 and later and is an error with some compilers
(e.g. clang in Xcode 12), and can thus cause configure checks to
produce incorrect results.
(cherry picked from commit 674fa0a740)

Co-authored-by: Joshua Root <jmr@macports.org>
2020-12-13 17:01:00 -05:00
Miss Islington (bot) be9e4402db
[3.9] bpo-41879: Doc: Fix description of async for statement (GH-23548) (GH-23749)
Fix the wording in the documentation of `async for` to correctly describe asynchronous iterables.  This fix is relevant for version 3.7 onward.
(cherry picked from commit 4b8cdfcb22)


Co-authored-by: Nick Gaya <nicholasgaya+github@gmail.com>
2020-12-12 20:24:31 -08:00
Andre Delfino c1a3f9a9cb
[3.9] [doc] Link to issue regarding logging.disable level param default value GH-23732
(cherry picked from commit 2a35137328)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-12-10 06:20:04 -08:00