Commit graph

108554 commits

Author SHA1 Message Date
Pablo Galindo
be17295280
[3.9] bpo-41697: Correctly handle KeywordOrStarred when parsing arguments in the parser (GH-22077) (GH-22079)
(cherry picked from commit 315a61f7a9)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-03 16:35:17 +01:00
Miss Islington (bot)
a5d0232b0d
bpo-39883: Use BSD0 license for code in docs (GH-17635) (GH-22073)
The PSF board approved this use.
(cherry picked from commit e223d06a8b)

Co-authored-by: Todd <toddrjen@gmail.com>
2020-09-03 07:40:10 -07:00
Pablo Galindo
8de34cdb95
[3.9] bpo-41690: Use a loop to collect args in the parser instead of recursion (GH-22053) (GH-22067)
This program can segfault the parser by stack overflow:

```
import ast

code = "f(" + ",".join(['a' for _ in range(100000)]) + ")"
print("Ready!")
ast.parse(code)
```

the reason is that the rule for arguments has a simple recursion when collecting args:

args[expr_ty]:
    [...]
    | a=named_expression b=[',' c=args { c }] {
        [...] }.
(cherry picked from commit 4a97b1517a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-02 21:30:51 +01:00
Shantanu
a763ee3c58
[3.9] bpo-39349: Add cancel_futures to Executor.shutdown base class (GH-22023) (GH-22048)
* Add cancel_futures parameter to the Executor base class, since it was missed in the original PR (https://github.com/python/cpython/pull/18057) that added cancel_futures.
(cherry picked from commit 17dc1b7)
2020-09-02 15:28:28 -04:00
Miss Islington (bot)
27183f48f2
Fix invalid escape sequences in the peg_highlight Sphinx extension (GH-22047) (GH-22065)
(cherry picked from commit 5a4a963a6c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-02 17:43:43 +01:00
Miss Islington (bot)
bafaf07275
[doc] Remove references to PyChecker. (GH-22054)
(cherry picked from commit dea82b6731)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-09-02 08:29:33 -05:00
Miss Islington (bot)
e2e033807f
Remove reference to Boa Constructor. (GH-22056)
(cherry picked from commit 1d25f5bf7b)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-09-02 08:29:16 -05:00
Miss Islington (bot)
63fa113c60
Fixed mistake in test for f-string error description (GH-22036) (GH-22059) (GH-22060)
(cherry picked from commit 749ed85e44)

Co-authored-by: han-solo <hanish0019@gmail.com>

Co-authored-by: han-solo <hanish0019@gmail.com>
2020-09-02 08:13:39 -04:00
Miss Islington (bot)
e2977f6202
Note the buffer slots can be set with PyType_Spec with the unlimited API. (GH-22052)
Follow up to f7c4e23642.
(cherry picked from commit 700fa1b836)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-09-01 22:18:21 -05:00
Pablo Galindo
d14775ddbb
[3.9] bpo-41654: Fix deallocator of MemoryError to account for subclasses (GH-22020) (GH-22045)
When allocating MemoryError classes, there is some logic to use
pre-allocated instances in a freelist only if the type that is being
allocated is not a subclass of MemoryError. Unfortunately in the
destructor this logic is not present so the freelist is altered even
with subclasses of MemoryError..
(cherry picked from commit 9b648a95cc)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-01 21:40:57 +01:00
Victor Stinner
4217b3c128
bpo-41617: Fix pycore_byteswap.h to support clang 3.0 (GH-22042) (GH-22044)
__builtin_bswap16() is not available in LLVM clang 3.0.

(cherry picked from commit e6905e4c82)
2020-09-01 20:54:37 +02:00
Miss Islington (bot)
c16a2a1b64
bpo-41681: Fix for f-string/str.format error description when using 2 , in format specifier (GH-22036) (GH-22041)
* Fixed `f-string/str.format` error description when using two `,` in format specifier.

Co-authored-by: millefalcon <hanish0019@hmail.com>
(cherry picked from commit 0d6aa7f0ee)

Co-authored-by: han-solo <hanish0019@gmail.com>

Co-authored-by: han-solo <hanish0019@gmail.com>
2020-09-01 11:45:59 -04:00
Miss Islington (bot)
ca55ecbf9a
bpo-41344: Raise ValueError when creating shared memory of size 0 (GH-21556) (GH-22018)
(cherry picked from commit 475a5fbb56)

Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>

Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>
2020-08-30 20:42:22 +01:00
Miss Islington (bot)
901c2eae6e
bpo-41524: fix pointer bug in PyOS_mystr{n}icmp (GH-21845) (GH-21978) 2020-08-30 15:53:09 +09:00
Miss Islington (bot)
6b5e88744c
bpo-41634: Fix a typo in the curses documentation (GH-21958)
(cherry picked from commit 398575c210)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-08-29 18:33:48 -04:00
Miss Islington (bot)
88b86a9752
bpo-19521: Fix parallel build race condition on AIX (GH-22001)
Patch by Michael Haubenwallner.
(cherry picked from commit e6dcd371b2)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-08-29 18:36:40 +02:00
Karthikeyan Singaravelan
c01a7edc67
[3.9] bpo-41624: fix documentation of typing.Coroutine (GH-21952) (#21982)
(cherry picked from commit 8c58d2a)

Co-authored-by: MingZhe Hu <humingzhework@163.com>

Co-authored-by: MingZhe Hu <humingzhework@163.com>
2020-08-28 08:06:31 -07:00
Miss Islington (bot)
7361451b97
bpo-41609: Fix output of pdb's whatis command for instance methods (GH-21935) (#21977)
(cherry picked from commit 022bc7572f)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2020-08-27 03:17:40 +02:00
Miss Islington (bot)
211e4c6e9c
bpo-33660: Fix PosixPath to resolve a relative path on root (#21974)
(cherry picked from commit 94ad6c674f)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-08-27 02:51:44 +02:00
Miss Islington (bot)
9de6be4e2a
bpo-37658: Fix asyncio.wait_for() to respect waited task status (GH-21894) (GH-21964)
Currently, if `asyncio.wait_for()` itself is cancelled it will always
raise `CancelledError` regardless if the underlying task is still
running.  This is similar to a race with the timeout, which is handled
already.
(cherry picked from commit a2118a1462)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2020-08-26 19:15:35 +02:00
Miss Islington (bot)
1036ccb55d
bpo-32751: Wait for task cancel in asyncio.wait_for() when timeout <= 0 (GH-21895) (GH-21963)
When I was fixing bpo-32751 back in GH-7216 I missed the case when
*timeout* is zero or negative.  This takes care of that.

Props to @aaliddell for noticing the inconsistency.
(cherry picked from commit c517fc7121)

Co-authored-by: Elvis Pranskevichus <elvis@magic.io>
2020-08-26 19:14:59 +02:00
Miss Islington (bot)
d7cd1164c1
Document vars behavior when __dict__ is missing (GH-21466) (GH-21939)
(cherry picked from commit 802726acf6)

Co-authored-by: Andre Delfino <adelfino@gmail.com>
2020-08-22 15:55:00 -03:00
Miss Islington (bot)
72d5ddb930
Fix grammar in Doc/tutorial/controlflow.rst (GH-21885) (#21922)
Automerge-Triggered-By: @csabella
(cherry picked from commit 0be7c216e1)

Co-authored-by: Denis Ovsienko <denis@ovsienko.info>
2020-08-22 05:08:02 -04:00
Miss Islington (bot)
f497bbeed0
bpo-40994: Ungroup items in collections.abc documentation for improved clarity (GH-21880) (#21926)
Use a less surprising document structure.

Automerge-Triggered-By: @csabella
(cherry picked from commit 2ce39631f6)

Co-authored-by: Sydney Pemberton <46042811+sydneypemberton1986@users.noreply.github.com>
2020-08-22 05:06:54 -04:00
Miss Islington (bot)
429a86a120
bpo-41573: Update release versions in General FAQ (GH-21915) (#21938)
(cherry picked from commit 7173fc84e6)
Co-authored-by: wyz23x2 <52805709+wyz23x2@users.noreply.github.com>
2020-08-22 03:47:37 -04:00
Miss Islington (bot)
a2d00f0473
bpo-41572: Fix grammar in BaseTransport.close docstring (GH-21914) (#21929)
Fix grammar in BaseTransport.close docstring.

https://bugs.python.org/issue41572

Signed-off-by: Cleber Rosa <crosa@redhat.com>
(cherry picked from commit 1afb42cfa8)

Co-authored-by: Cleber Rosa <cleber.gnu@gmail.com>
2020-08-21 17:49:40 +05:30
Miss Islington (bot)
3949827a54
Doc: add a missing period (GH-21819) (#21932)
(cherry picked from commit 12695f4c6d)

Co-authored-by: Mathieu Dupuy <deronnax@gmail.com>

Co-authored-by: Mathieu Dupuy <deronnax@gmail.com>
2020-08-20 17:40:57 -03:00
Victor Stinner
8f88190af5
[3.9] bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844) (GH-21901)
* bpo-40204: Allow pre-Sphinx 3 syntax in the doc (GH-21844)

Enable Sphinx 3.2 "c_allow_pre_v3" option and disable the
c_warn_on_allowed_pre_v3 option to make the documentation compatible
with Sphinx 2 and Sphinx 3.

(cherry picked from commit 423e77d6de)

* bpo-40204: Fix Sphinx sytanx in howto/instrumentation.rst (GH-21858)

Use generic '.. object::' to declare markers, rather than abusing
'..  c:function::' which fails on Sphinx 3.

(cherry picked from commit 43577c01a2)

* bpo-40204: Fix duplicates in the documentation (GH-21857)

Fix two Sphinx 3 issues:

Doc/c-api/buffer.rst:304: WARNING: Duplicate C declaration, also defined in 'c-api/buffer'.
Declaration is 'PyBUF_ND'.

Doc/c-api/unicode.rst:1603: WARNING: Duplicate C declaration, also defined in 'c-api/unicode'.
Declaration is 'PyObject* PyUnicode_Translate(PyObject *str, PyObject *table, const char *errors)'.

(cherry picked from commit 46d10b1237)

* bpo-40204: Add :noindex: in the documentation (GH-21859)

Add :noindex: to duplicated documentation to fix "duplicate object
description" errors.

For example, fix this Sphinx 3 issue:

Doc/library/configparser.rst:1146: WARNING: duplicate object
description of configparser.ConfigParser.optionxform, other instance
in library/configparser, use :noindex: for one of them

(cherry picked from commit d3ded08048)

* bpo-40204, doc: Fix syntax of C variables (GH-21846)

For example, fix the following Sphinx 3 errors:

Doc/c-api/buffer.rst:102: WARNING: Error in declarator or parameters
Invalid C declaration: Expected identifier in nested name. [error at 5]
  void \*obj
  -----^

Doc/c-api/arg.rst:130: WARNING: Unparseable C cross-reference: 'PyObject*'
Invalid C declaration: Expected end of definition. [error at 8]
  PyObject*
  --------^

The modified documentation is compatible with Sphinx 2 and Sphinx 3.

(cherry picked from commit 474652fe93)

* bpo-40204: Fix reference to terms in the doc (GH-21865)

Sphinx 3 requires to refer to terms with the exact case.

For example, fix the Sphinx 3 warning:

Doc/library/pkgutil.rst:71: WARNING: term Loader not found in case
sensitive match.made a reference to loader instead.

(cherry picked from commit bb0b08540c)

* bpo-40204: Fix duplicated productionlist names in the doc (GH-21900)

Sphinx 3 disallows having more than one productionlist markup with
the same name. Simply remove names in this case, since names are not
shown anyway. For example, fix the Sphinx 3 warning:

Doc/reference/introduction.rst:96: duplicate token description
of *:name, other instance in reference/expressions

(cherry picked from commit 1abeda80f7)
2020-08-19 19:25:22 +02:00
Miss Islington (bot)
e3cafebb5c
bpo-41568: Fix refleaks in zoneinfo subclasses (GH-21907)
* Fix refleak in C module __init_subclass__

This was leaking a reference to the weak cache dictionary for every
ZoneInfo subclass created.

* Fix refleak in ZoneInfo subclass's clear_cache

The previous version of the code accidentally cleared the global
ZONEINFO_STRONG_CACHE variable (and inducing `ZoneInfo` to create a new
strong cache) on calls to a subclass's `clear_cache()`. This would not
affect guaranteed behavior, but it's still not the right thing to do
(and it caused reference leaks).
(cherry picked from commit c3dd7e45cc)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2020-08-17 16:24:15 -07:00
Miss Islington (bot)
d6bdf6d52f
bpo-40782: Change asyncio.AbstractEventLoop.run_in_executor to be a method not a coroutine (GH-21852)
asyncio.AbstractEventLoop.run_in_executor should be a method that returns an asyncio Future, not an async method.
This matches the concrete implementations, and the documentation better.
(cherry picked from commit 29f84294d8)

Co-authored-by: James Weaver <james.barrett@bbc.co.uk>
2020-08-17 07:40:26 -07:00
Miss Islington (bot)
2c050e52f1
[3.9] bpo-41503: Fix race between setTarget and flush in logging.handlers.MemoryHandler (GH-21765) (GH-21897)
(cherry picked from commit 2353d77fad)


Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>

Automerge-Triggered-By: @vsajip
2020-08-16 08:34:27 -07:00
Miss Islington (bot)
28bf82661a
bpo-41540: AIX: skip test that is flaky with a default ulimit. (GH-21890) (#21893)
- AIX has extreme over-allocation that is in no relation to the physical
    RAM and swap.

(cherry picked from commit 39dab24621)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-08-15 20:40:14 +02:00
Miss Islington (bot)
1864eacc22
bpo-40878: xlc cannot handle C99 extern inline. (GH-21891)
This applies to the default "extc99" mode.  Python does not compile with "stdc99".

(cherry picked from commit 40e700ad04)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-08-15 20:37:08 +02:00
Miss Islington (bot)
fc8ffe27b6
bpo-31122: ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation (GH-18772)
[bpo-31122](): ssl.wrap_socket() now raises ssl.SSLEOFError rather than OSError when peer closes connection during TLS negotiation

Reproducer: http://tiny.cc/f4ztnz (tiny url because some bot keeps renaming b.p.o.-nnn as bpo links)
(cherry picked from commit 495bd03566)

Co-authored-by: Dima Tisnek <dimaqq@gmail.com>
2020-08-15 10:44:57 -07:00
Miss Islington (bot)
31bc45c4b2
Fix typo in typing doc (GH-21879)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit fa5d725198)

Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
2020-08-14 16:10:14 -07:00
Miss Islington (bot)
33d3c64095
bpo-41025: Fix subclassing for zoneinfo.ZoneInfo (GH-20965) (GH-21876)
Prior to this change, attempting to subclass the C implementation of
zoneinfo.ZoneInfo gave the following error:

    TypeError: unbound method ZoneInfo.__init_subclass__() needs an argument

https://bugs.python.org/issue41025
(cherry picked from commit 87d8287865)

Co-authored-by: Paul Ganssle <paul@ganssle.io>
2020-08-14 11:18:24 -04:00
Miss Islington (bot)
7c288413db
bpo-41410: Fix outdated info in mkstemp docs (GH-21701)
Automerge-Triggered-By: @ericvsmith
(cherry picked from commit e55de68be3)

Co-authored-by: Rishav Kundu <rk@rishav.io>
2020-08-13 18:53:43 -07:00
Miss Islington (bot)
75c2281762
bpo-41526: Fixed layout of final page of the installer (GH-21871)
(cherry picked from commit 6444ca9469)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-08-13 16:55:37 -07:00
Miss Islington (bot)
7fcd515c35
Fixed comment about pathlib.link_to: it was added in 3.8, not changed. (GH-21851)
(cherry picked from commit a3eae43aee)

Co-authored-by: Facundo Batista <facundo@taniquetil.com.ar>
2020-08-13 13:54:48 -07:00
Miss Islington (bot)
3dd1153b99
bpo-41066: Update the comparison section for os vs pathlib (GH-21261)
(cherry picked from commit 0eb9deb4a6)

Co-authored-by: Srinivas Reddy Thatiparthy (శ్రీనివాస్  రెడ్డి తాటిపర్తి) <thatiparthysreenivas@gmail.com>
2020-08-13 12:59:07 -07:00
Terry Jan Reedy
f24430f154
[3.9] bpo-41520: Fix second codeop regression (GH-21848)
Fix the repression introduced by the initial regression fix.

(cherry picked from commit c818b15fa5)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-08-13 14:21:32 -04:00
Guido van Rossum
b3ad2ca56a
[3.9] bpo-40979: refactored typing.rst; (mostly) same content, new sub-sections and ordering (GH-21574) (#21843)
Also added PEP 585 deprecation notes.

(cherry picked from commit ab72fdeb82)

Co-authored-by: Luciano Ramalho <luciano@ramalho.org>
2020-08-12 11:10:12 -07:00
Miss Islington (bot)
90eff4ed44
bpo-41520: codeop no longer ignores SyntaxWarning (GH-21838)
(cherry picked from commit 369a1cbdee)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-08-12 06:13:09 -07:00
Łukasz Langa
6e21a30215
Post 3.9.0rc1 2020-08-11 23:29:16 +02:00
Łukasz Langa
03e92654c9 Python 3.9.0rc1
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCgAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl8y6lgACgkQsmmV4xAl
 BWhXjQ//XABukXJGoE4HrTusljOIn8ZmkBJbvhyaCmb83khYZHJmeExcV3UwDJE7
 U3fOfApErWwa79cn4ZI/naHAok8T4TFb0f2qvGuincG16FwTKpe/HyuMHq1OOzKn
 cCOtgulUuKG7kglykRxVSFym32Ch7y2pAVgtX8k3zwTdknx8UrfSX0mfFNQWgPgz
 ThXMIWy3PqFj1SFoOCjFq4ab8GhIcHSD4fxCibiGfZRJI7D7iJk2nHH29e0JOrwt
 ZA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V2VRbFw1osia0G7u
 l0MnWPAohfIEJG61l9kUVUj46k2Xeu2yU6e+RL/jthlczGLAehSGJTkF9IuKqYL1
 KU2RT+WYoIBKuMS4JsXgN7XQr1QrJq30el6LxpzADMvdNjAroip8ooUQRjbbjOB1
 KtDOOHl+BYTROsupH3Y2yxxXcgaKJlGyA84MWtbcljXQKAxaQHnDLh7Q820obClX
 WMo5UNBl1Q==
 =FI9l
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.0rc1' into 3.9

Python 3.9.0rc1
2020-08-11 23:28:53 +02:00
Guido van Rossum
d1d6a1c6ab
[3.9] bpo-41504: Add links to asttokens, leoAst, LibCST and parso to ast docs (GH-21773) (GH-21830)
(cherry picked from commit e3c971ccfa)

Co-authored-by: Edward K. Ream <edreamleo@gmail.com>

Co-authored-by: Edward K. Ream <edreamleo@gmail.com>
2020-08-11 14:04:26 -07:00
Łukasz Langa
439c93d51f
Python 3.9.0rc1 2020-08-11 20:58:17 +02:00
Miss Islington (bot)
5de00f63d4
bpo-41475: Fix note in "What's new in 3.7" (GH-21733) (#21832)
(cherry picked from commit 76643c10ed)

Co-authored-by: Ram Rachum <ram@rachum.com>
2020-08-11 19:03:21 +02:00
Miss Islington (bot)
2146e516ec
Add PEP 573 additions to What's New (GH-21374) (GH-21831)
(cherry picked from commit af3a6a8cae)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2020-08-11 18:34:20 +02:00
Victor Stinner
a0b57b3317
bpo-38912: regrtest logs unraisable exception into sys.__stderr__ (GH-21718) (GH-21827)
regrtest_unraisable_hook() temporarily replaces sys.stderr with
sys.__stderr__ to help to display errors when a test captures stderr.

(cherry picked from commit 701b63894f)
2020-08-11 17:03:33 +02:00