Commit Graph

23736 Commits

Author SHA1 Message Date
Serhiy Storchaka 7aa22ba923
[3.9] bpo-41909: Enable previously disabled recursion checks. (GH-22536) (GH-22550)
Enable recursion checks which were disabled when get __bases__ of
non-type objects in issubclass() and isinstance() and when intern
strings. It fixes a stack overflow when getting __bases__ leads
to infinite recursion.

Originally recursion checks was disabled for PyDict_GetItem() which
silences all errors including the one raised in case of detected
recursion and can return incorrect result. But now the code uses
PyDict_GetItemWithError() and PyDict_SetDefault() instead.
(cherry picked from commit 9ece9cd65c)
2020-10-05 01:27:38 +03:00
Miss Islington (bot) e8165e79f5
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370)
(cherry picked from commit 62e40d8450)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-10-04 19:19:18 +02:00
Łukasz Langa c26a666e67
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (#22397)
Closes bpo issue 41602.
(cherry picked from commit a68a2ad19c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2020-10-04 18:40:36 +02:00
Miss Islington (bot) bd55c46895
bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
GH- [bpo-41815](): SQLite: fix segfault if backup called on closed database

Attempting to backup a closed database will trigger segfault:

```python
import sqlite3
target = sqlite3.connect(':memory:')
source = sqlite3.connect(':memory:')
source.close()
source.backup(target)
```
(cherry picked from commit bfee9fad84)

Co-authored-by: Peter McCormick <peter@pdmccormick.com>
2020-10-04 18:36:45 +02:00
Miss Islington (bot) df71b65a88
bpo-41875: Use __builtin_unreachable when possible (GH-22433)
(cherry picked from commit 24ba3b0df5)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-10-04 18:19:34 +02:00
Serhiy Storchaka 3d87eee300
[3.9] Remove duplicated words words (GH-20413). (GH-22296)
(cherry picked from commit 1c5d1d7304)
2020-10-04 17:32:39 +02:00
Pablo Galindo 7b7aa94e51
[3.9] bpo-41840: Report module-level globals as both local and global in the symtable module (GH-22391). (GH-22528)
(cherry picked from commit fb0a4651f1)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-10-03 21:23:03 +01:00
Miss Skeleton (bot) a0f2b66433
bpo-41900: C14N 2.0 serialisation failed for unprefixed attributes when a default namespace was defined. (GH-22474) (GH-22507)
(cherry picked from commit 6a412c94b6)
2020-10-03 08:41:35 +02:00
Miss Islington (bot) 868c8e41eb
bpo-41774: Add programming FAQ entry (GH-22402)
In the "Sequences (Tuples/Lists)" section, add
"How do you remove multiple items from a list".
(cherry picked from commit 5b0181d1f6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-09-28 22:27:06 -07:00
Miss Islington (bot) cca896e13b
bpo-41875: Use __builtin_unreachable when possible (GH-22433)
(cherry picked from commit 24ba3b0df5)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-09-28 15:16:24 -07:00
Miss Islington (bot) 048f54dc75
bpo-40105: ZipFile truncate in append mode with shorter comment (GH-19337)
(cherry picked from commit ff9147d93b)

Co-authored-by: Jan Mazur <16736821+mzr@users.noreply.github.com>
2020-09-28 13:18:47 -07:00
Miss Islington (bot) 4080f12ccc
bpo-41775: Make 'IDLE Shell' the shell title (GH-22399)
'Python Shell' may have contributed to some beginners confusing 'IDLE' with ' Python'.
(cherry picked from commit 05cc881cbc)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-09-24 13:07:49 -07:00
Łukasz Langa ca8d46dd42
[3.9] bpo-41602: raise SIGINT exit code on KeyboardInterrupt from pymain_run_module (GH-21956) (#22397)
Closes bpo issue 41602.
(cherry picked from commit a68a2ad19c)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2020-09-24 16:34:21 +02:00
Miss Islington (bot) 64362c2e43
bpo-37062: Enum: add extended AutoNumber example (GH-22349) (GH-22370)
(cherry picked from commit 62e40d8450)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-22 20:58:32 -07:00
Miss Islington (bot) f27a1577d3
bpo-35764: Rewrite the IDLE Calltips doc section (GH-22363) 2020-09-22 14:35:38 -04:00
Miss Islington (bot) b38ad22705
fix `EventType` bases
`StrEnum` does not exist in 3.8, so use original `(str, enum.Enum)` bases.
2020-09-22 11:31:22 -07:00
Miss Islington (bot) 6b731c4878
bpo-40181: Remove '/' reminder in IDLE calltips. (GH-22350)
The marker was added to the language in 3.8 and
3.7 only gets security patches.
(cherry picked from commit 40a0625792)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-09-21 23:05:07 -07:00
Miss Islington (bot) 4ee30c4244
bpo-41815: SQLite: segfault if backup called on closed database (GH-22322)
GH- [bpo-41815](): SQLite: fix segfault if backup called on closed database

Attempting to backup a closed database will trigger segfault:

```python
import sqlite3
target = sqlite3.connect(':memory:')
source = sqlite3.connect(':memory:')
source.close()
source.backup(target)
```
(cherry picked from commit bfee9fad84)

Co-authored-by: Peter McCormick <peter@pdmccormick.com>
2020-09-21 15:05:17 -07:00
Miss Islington (bot) f3e0eceff6
bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
* bpo-35293: Remove RemovedInSphinx40Warning

* Update Misc/NEWS.d/next/Documentation/2020-09-12-17-37-13.bpo-35293._cOwPD.rst

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

* bpo-35293: Apply Victor's review

Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 6595cb0af4)

Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2020-09-18 02:38:41 -07:00
Serhiy Storchaka 234ae8fe1b
[3.9] Remove duplicated words words (GH-20413). (GH-22296)
(cherry picked from commit 1c5d1d7304)
2020-09-18 09:36:14 +03:00
Łukasz Langa 274e9cee50 Python 3.9.0rc2
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl9igmMACgkQsmmV4xAl
 BWg4KxAAl14iSJW6ezGdbzJMjaR8+c94rYTSuOVqSmFdWMFdrvcR0R2CPj49aIRG
 wz/Hux0Qj/gc9GRTSaG3KAJBR9jJAV6xIczBeM9+z825ALNLTCU+Sn744Pnjrg6n
 bUboabEHU6eTQjS7dgjqYT8Zyb+YrgbGNoJxydocIrAvU0A15pq750hfp1/vRG1/
 R339Z1ZxnGK1akuDISs8PIxVHOZy0y8u7THoEtCAZB2e71k6Iy3T2ek1RGuvtTHU
 FeQw71J1E0nXeT53o/GebA3oxX1816NmmZU0Uo8AZ6ERiPY0uBbhn5YpLmWeRi9D
 i8djOVLvtg+5sD+pSmv4ouTZ0dr4WLEUAT5EJ2O+u5t5kYz4kVih78ohnei+qLYt
 PpZh/+8xoL8DmcdvmoeTziPZYlkOLL0BLC0h+QUyIzHMdTJjbVrg9wtt6NjIr5Aj
 /M76scXEG/mtON50az21niTogF47YkGx+oFjAXref2uqheTZUHSFw3/vJC2deXuM
 Fu9ZIaohjMa+LBlk/J4CrpvuG/i0u64HTUfsE6zkMLV8NcO8eDIr77KT9fEEtwNb
 LPUtn+RakFrvzDy/uTNRF7fl1Ce6b4v/o/ZtvPv95LVVxeJCHjD4yh8FNYN+Fopz
 O9ixqsCKBkkohV5rsK+ERWBGVyJOzo4MqlSTtr/QOWfkgUkLaOw=
 =SY6G
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJEBAABCAAuFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl9jIigQHGx1a2FzekBs
 YW5nYS5wbAAKCRCyaZXjECUFaLPVD/wND/PFsZYRiG708joP2WIaBJuWn3RxEgVo
 5QlvWDv7f21okv20BzNWMHzdLJIY3jbiYjRYdztVCEPJgS3+eAju05cdKPc5YwbP
 2LOT0JB6k7JI3wweQxGL61UTpReNkYknogmXgRoy8//qexpBwBRhAo+sPzKj0czU
 4JPTf62++B05JxbKIT8PmYptK/A8QpP5HNK1pZCPDj1XzBmtYRv7JLl7U3dPpcJZ
 nR1L+oNQhq6fnihaQ+ttqpYsPIzuzVOGMz/TyPSOB1Q6tn172UvfAPLu/hX3iESq
 gSkuq/9H/9EvI6gX2e/TrsjUFR41EUU4lLEAyFr9ffdUyJjqZ4vbSjdpr7pX0lmF
 /USeYGsDg6EbToaw0E/mGPRTLZWf5GRSwIcNLVjE/HgxgnE5aFRkP7mhg5ZqUKFB
 mdhlIlsY884upqugeq+yK/XSobwS8YR8R6+Ah72P2iTRLtNw6Yg89tJaaN81kK1J
 hw4PlMfG9Z9gnN1qBVKKArpyRLOQq915I8TMWAsPx10KznbGjBJg6wo7bVL6mmRP
 Z1QLXaucnhNGdcZcGgOTBf0A+eghnvc/tEbjy2Utznu1/onhfleKeqLSegq0lmOI
 AeBfBNzv1QDiwnPm8dGB0i2C1Yg9tEzWRc8Ad+2NGGYTD0o87bTk0raiPTAjrPCW
 dCYYmD+iGA==
 =9JS2
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.0rc2' into 3.9

Python 3.9.0rc2
2020-09-17 10:45:24 +02:00
Miss Islington (bot) f76a3889d1
bpo-41662: Fix bugs in binding parameters in sqlite3 (GH-21998)
* When the parameters argument is a list, correctly handle the case
  of changing it during iteration.
* When the parameters argument is a custom sequence, no longer
  override an exception raised in ``__len__()``.
(cherry picked from commit 0b419b7910)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-09-17 00:57:07 -07:00
Ethan Furman a9ba8ba9a7
[3.9] bpo-39728: Enum: fix duplicate `ValueError` (GH-22277) (GH-22282)
fix default `_missing_` to return `None` instead of raising a `ValueError`
Co-authored-by: Andrey Darascheka <andrei.daraschenka@leverx.com>
(cherry picked from commit c95ad7a91f)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-16 17:37:51 -07:00
Łukasz Langa 2bd31b5fde
Python 3.9.0rc2 2020-09-16 23:23:13 +02:00
Miss Islington (bot) 48f99250ff
bpo-41517: do not allow Enums to be extended (GH-22271)
fix bug that let Enums be extended via multiple inheritance
(cherry picked from commit 3064dbf5df)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2020-09-16 07:35:14 -07:00
Łukasz Langa 7e356f17e4
[3.9] bpo-41687: Fix sendfile implementation to work with Solaris (GH-22040) (GH-22273)
(cherry picked from commit 8c0be6fd91)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2020-09-16 13:52:26 +02:00
Ethan Furman a4677068dd
[3.9] bpo-41789: honor object overrides in Enum classes (GH-22250) (GH-22272)
EnumMeta double-checks that `__repr__`, `__str__`, `__format__`, and `__reduce_ex__` are not the same as `object`'s, and replaces them if they are -- even if that replacement was intentionally done in the Enum being constructed.  This patch fixes that.
2020-09-16 03:58:33 -07:00
Miss Islington (bot) 95b81e2f8c
bpo-39587: Enum - use correct mixed-in data type (GH-22263) (GH-22266)
(cherry picked from commit bff01f3a3a)
2020-09-15 16:59:48 -07:00
Miss Islington (bot) 49917d576a
bpo-41780: Fix __dir__ of types.GenericAlias (GH-22262)
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit 2e87774df1)

Co-authored-by: Batuhan Taskaya <isidentical@gmail.com>
2020-09-15 16:37:13 -07:00
Pablo Galindo 55e0836849
[3.9] bpo-41631: _ast module uses again a global state (GH-21961) (GH-22258)
Partially revert commit ac46eb4ad6662cf6d771b20d8963658b2186c48c:
"bpo-38113: Update the Python-ast.c generator to PEP384 (gh-15957)".

Using a module state per module instance is causing subtle practical
problems.

For example, the Mercurial project replaces the __import__() function
to implement lazy import, whereas Python expected that "import _ast"
always return a fully initialized _ast module.

Add _PyAST_Fini() to clear the state at exit.

The _ast module has no state (set _astmodule.m_size to 0). Remove
astmodule_traverse(), astmodule_clear() and astmodule_free()
functions..
(cherry picked from commit e5fbe0cbd4)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-15 20:32:56 +02:00
Miss Islington (bot) 7dfcc8e079
bpo-39651: Fix asyncio proactor _write_to_self() (GH-22197)
Fix a race condition in the call_soon_threadsafe() method of
asyncio.ProactorEventLoop: do nothing if the self-pipe socket has
been closed.
(cherry picked from commit 1b0f0e3d7d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-09-12 00:11:38 -07:00
Miss Islington (bot) 34e3c7592b
bpo-41731: Make test_cmd_line_script pass with -vv (GH-22206)
Argument script_exec_args is usually an absolute file name,
but twice has form ['-m', 'module_name'].
(cherry picked from commit 7e711ead26)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-09-11 23:45:34 -07:00
Miss Islington (bot) 1b4bdb4cd7
bpo-37149: Change Shipman tkinter link from archive.org to TkDocs (GH-22188)
The new link responds much faster and begins with a short explanation of the status of the doc.
(cherry picked from commit 06d0b8b67e)

Co-authored-by: Mark Roseman <mark@markroseman.com>
2020-09-10 13:19:29 -07:00
Miss Islington (bot) 5dd8b3d27a
Fix incorrect bpo number in change notes. (GH-22151) (#22174) 2020-09-09 17:33:21 +01:00
Miss Islington (bot) 11a82c7220
bpo-41525: Make the Python program help ASCII-only (GH-21836)
(cherry picked from commit 58de1dd6a8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-09-08 17:47:53 -07:00
Miss Islington (bot) 1671b0e4e0
bpo-41720: Add "return NotImplemented" in turtle.Vec2D.__rmul__(). (GH-22092)
(cherry picked from commit fd4cafd470)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-09-07 09:30:21 -07:00
Miss Islington (bot) d64d78be20
bpo-41531: Fix compilation of dict literals with more than 0xFFFF elements (GH-21850) (GH-22107)
(cherry picked from commit c51db0ea40)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-09-05 00:38:50 +01:00
Miss Islington (bot) e92219d8f8
bpo-29590: fix stack trace for gen.throw() with yield from (GH-19896)
* Add failing test.

* bpo-29590: fix stack trace for gen.throw() with yield from (GH-NNNN)

When gen.throw() is called on a generator after a "yield from", the
intermediate stack trace entries are lost.  This commit fixes that.
(cherry picked from commit 8b33961e4b)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-09-04 16:07:18 -07:00
Miss Islington (bot) 106c1df736
closes bpo-41533: Fix a potential memory leak when allocating a stack (GH-21847)
Free the stack allocated in va_build_stack if do_mkstack fails
and the stack is not a small_stack
(cherry picked from commit 75c80b0bda)

Co-authored-by: Tony Solomonik <tony.solomonik@gmail.com>
2020-09-04 15:56:04 -07:00
Miss Islington (bot) a2680058ee
bpo-41696: Fix handling of debug mode in asyncio.run (GH-22069) (#22071)
* bpo-41696: Fix handling of debug mode in asyncio.run

This allows PYTHONASYNCIODEBUG or -X dev to enable asyncio debug mode
when using asyncio.run

* 📜🤖 Added by blurb_it.

Co-authored-by: hauntsaninja <>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit 0770ad948c)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2020-09-03 13:54:09 -07:00
Miss Islington (bot) 49571c0b0e
bpo-39010: Fix errors logged on proactor loop restart (GH-22017) (#22034)
Stopping and restarting a proactor event loop on windows can lead to
spurious errors logged (ConnectionResetError while reading from the
self pipe). This fixes the issue by ensuring that we don't attempt
to start multiple copies of the self-pipe reading loop.
(cherry picked from commit ea5a6363c3)

Co-authored-by: Ben Darnell <ben@bendarnell.com>

Co-authored-by: Ben Darnell <ben@bendarnell.com>
2020-09-03 12:38:29 -07: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
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
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
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) 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) 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) 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) 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
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 439c93d51f
Python 3.9.0rc1 2020-08-11 20:58:17 +02:00
Miss Islington (bot) a9fa66377f
bpo-41468: Improve and test IDLE run error exit (GH-21798)
A message box pops up when an unexpected error stops the run process.  Tell users it is likely a random glitch, but report it if not.
(cherry picked from commit f2e161c279)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-08-09 13:26:21 -07:00
Miss Islington (bot) d9106434f7
bpo-41497: Fix potential UnicodeDecodeError in dis CLI (GH-21757)
(cherry picked from commit a4084b9d1e)

Co-authored-by: Konge <zkonge@outlook.com>
2020-08-07 20:24:12 -07:00
Steve Dower 70e9243a55
bpo-41490: Update ensurepip to install pip 20.2.1 and setuptools 49.2.1 (GH-21774) 2020-08-08 00:47:40 +01:00
Miss Islington (bot) fc354ca51d
bpo-39871: Fix an error in a news entry (GH-21749)
(cherry picked from commit 5463635580)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-08-06 22:45:49 -07:00
Miss Islington (bot) 1437bb06a9
bpo-41492: Fixes the description appearing in UAC prompts on Windows (GH-21754)
(cherry picked from commit 777b611c8c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-08-06 09:54:52 -07:00
Miss Islington (bot) a1320989f5
bpo-40726: handle uninitalized end_lineno on ast.increment_lineno (GH-20312)
(cherry picked from commit 8f4380d2f5)

Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
2020-08-05 06:52:29 -07:00
Miss Islington (bot) 1d16229f3f
bpo-41467: Fix asyncio recv_into() on Windows (GH-21720)
On Windows, fix asyncio recv_into() return value when the socket/pipe
is closed (BrokenPipeError): return 0 rather than an empty byte
string (b'').
(cherry picked from commit 602a971a2a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-08-03 18:00:29 -07:00
Miss Islington (bot) 3c4fc864ce
bpo-41425: Make tkinter doc example runnable (GH-21706)
Co-authored-by: Ankit Chandawala <achandaw@amazon.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit c36dbac588)
2020-08-03 00:25:30 -04:00
Miss Islington (bot) 22216107f2
closes bpo-38156: Always handle interrupts in PyOS_StdioReadline. (GH-21569)
This consolidates the handling of my_fgets return values, so that interrupts are always handled, even if they come after EOF.

 I believe PyOS_StdioReadline is still buggy in that I/O errors will not result in a proper Python exception being set. However, that is a separate issue.
(cherry picked from commit a74eea238f)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2020-07-28 18:16:19 -07:00
Miss Islington (bot) 95cc37f6b8
bpo-41412 and bpo-40948: Windows installer updates (GH-21656)
Prevent installation on Windows 8 and earlier.
Download UCRT on demand when required (non-updated Windows 8.1 only)
Add reference to py launcher to post-install message
(cherry picked from commit 37a06cbe5c)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-28 08:55:38 -07:00
Guido van Rossum e962e3f65a
[3.9] bpo-41045: Document debug feature of f-strings ('=') (GH-21509) (GH-21645)
Co-Authored-By: Rishi <rishi93dev@gmail.com>

(cherry picked from commit 13efaec)

Co-authored-by: amaajemyfren <32741226+amaajemyfren@users.noreply.github.com>
2020-07-27 16:01:49 -07:00
Miss Islington (bot) 8b052751d3
bpo-41384: Raise TclError in tkinter.OptionMenu (GH-21601)
... when an unknown option is passed.  TypeError was being raised because a 2to3 fix was missing.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit f1d40f941a)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
2020-07-26 22:14:12 -04:00
Miss Islington (bot) 6e4975a1c7
bpo-41182 selector: use DefaultSelector based upon implementation (GH-21257)
On some platform such as VMware ESXi, DefaultSelector fails
to detect selector due to default value.
This fix adds a check and uses the correct selector depending upon
select implementation and actual call.

Fixes: [bpo-41182]()

Signed-off-by: Abhijeet Kasurde <akasurde@redhat.com>
(cherry picked from commit bcd47837a9)

Co-authored-by: Abhijeet Kasurde <akasurde@redhat.com>
2020-07-26 08:32:25 -07:00
Miss Islington (bot) 41d1c04f73
bpo-41341: Recursive evaluation of ForwardRef in get_type_hints (GH-21553)
The issue raised by recursive evaluation is infinite recursion with
recursive types. In that case, only the first recursive ForwardRef is
evaluated.
(cherry picked from commit 653f420b53)

Co-authored-by: wyfo <joperez@hotmail.fr>
2020-07-26 08:31:24 -07:00
Miss Islington (bot) fdc91c2e60
bpo-41314: fixed annotations __future__ version (GH-21616)
PEP 563 was updated to change the release where `from __future__ import annotations` becomes the default (and only) behavior from 4.0 to 3.10. Update `__future__.py` and its docs to reflect this.
(cherry picked from commit 0028c14073)

Co-authored-by: YoSTEALTH <35307184+YoSTEALTH@users.noreply.github.com>
2020-07-25 15:00:48 -07:00
Berker Peksag 2024d7aca1
bpo-38731: Fix NameError in command-line interface of py_compile (GH-21617) 2020-07-25 23:43:47 +03:00
Miss Islington (bot) 15fdbb7145
bpo-41373: IDLE: Fix saving files loaded with no newlines or mixed newlines (GH-21597)
Fixes regression in 3.8.4 and 3.9.0b4.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 0dd463c8a4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-24 20:39:31 -07:00
Miss Islington (bot) 4ff8e5ba4f
bpo-41317: Remove reader on cancellation in asyncio.loop.sock_accept() (GH-21595)
(cherry picked from commit 0dd98c2d00)

Co-authored-by: Alex Grönholm <alex.gronholm@nextday.fi>
2020-07-23 13:02:47 -07:00
Miss Islington (bot) 4cf7afcefc
bpo-4630: Fix errors in Lib/idlelib/NEWS.txt (GH-21594)
Also one in news log.
(cherry picked from commit 592527f3ee)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-22 23:25:59 -07:00
Miss Islington (bot) 00466db221
bpo-41364: Reduce import overhead of uuid module (GH-21586)
(cherry picked from commit bf2f76ec09)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-21 17:09:32 -07:00
Miss Islington (bot) d6ba8c8e16
bpo-40741: Update Windows build to include SQLite 3.32.3 (GH-21570)
(cherry picked from commit 84761c3cc4)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-20 17:10:32 -07:00
Łukasz Langa 8ad7d506ca
Python 3.9.0b5 2020-07-20 19:47:09 +02:00
Miss Islington (bot) 46634b7aa8
bpo-37703: improve asyncio.gather documentation regarding cancellation (GH-15312)
These changes updates the doc to comprehensively mention the behaviour of gather.cancel()

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

Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>
2020-07-20 02:01:39 -07:00
Miss Islington (bot) 2fbb0d8da9
bpo-40741: Update macOS installer to use SQLite 3.32.3 (GH-20979)
(cherry picked from commit 7cf1cb36ec)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-07-19 23:37:50 -07:00
Miss Islington (bot) 01ab963460
bpo-41295: Reimplement the Carlo Verre "hackcheck" (GH-21528)
Walk down the MRO backwards to find the type that originally defined the final `tp_setattro`, then make sure we are not jumping over intermediate C-level bases with the Python-level call.

Automerge-Triggered-By: @gvanrossum
(cherry picked from commit c53b310e59)

Co-authored-by: scoder <stefan_ml@behnel.de>
2020-07-18 14:39:02 -07:00
Miss Islington (bot) 27b811057f
bpo-39603: Prevent header injection in http methods (GH-18485)
reject control chars in http method in http.client.putrequest to prevent http header injection
(cherry picked from commit 8ca8a2e8fb)

Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
2020-07-18 13:41:55 -07:00
Miss Islington (bot) a16ac4e43c
bpo-41304: Update NEWS to include CVE-2020-15801 reference (GH-21521)
(cherry picked from commit 164b04c47e)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-17 17:53:56 +01:00
Miss Islington (bot) 5a7aa28045
bpo-41300: IDLE - save files with non-ascii chars (GH-21512)
Fix regression released in 3.9.0b4 and 3.8.4.
(cherry picked from commit 38d3864efe)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-16 15:42:09 -07:00
Miss Islington (bot) 28e93dd2b2
bpo-41304: Ensure python3x._pth is loaded on Windows (GH-21495)
(cherry picked from commit 936a660945)

Co-authored-by: Steve Dower <steve.dower@python.org>
2020-07-15 15:14:48 -07:00
Miss Islington (bot) f3232294ee
[3.9] bpo-39017: Avoid infinite loop in the tarfile module (GH-21454) (GH-21482)
Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
(cherry picked from commit 5a8d121a1f)


Co-authored-by: Rishi <rishi_devan@mail.com>

Automerge-Triggered-By: @encukou
2020-07-15 05:30:33 -07:00
Miss Islington (bot) 57c984fab6
bpo-41288: Fix a crash in unpickling invalid NEWOBJ_EX. (GH-21458)
Automerge-Triggered-By: @tiran
(cherry picked from commit 4f309abf55)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-07-13 06:09:27 -07:00
Miss Islington (bot) 51b36ed96d
bpo-41175: Guard against a NULL pointer dereference within bytearrayobject (GH-21240)
The issue is triggered by the bytearray() + bytearray() operation.

Detected by GCC 10 static analysis tool.
(cherry picked from commit 61fc23ca10)

Co-authored-by: stratakis <cstratak@redhat.com>
2020-07-10 03:18:45 -07:00
Miss Islington (bot) fd27fb7f3d
bpo-37765: Add keywords to IDLE tab completions (GH-15138)
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.

Rewrite Completions doc.

Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
(cherry picked from commit bce2eb4646)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2020-07-09 15:54:14 -07:00
Miss Islington (bot) 90584c02b4
bpo-41252: Fix incorrect refcounting in _ssl.c's _servername_callback() (GH-21407)
(cherry picked from commit ee96f32ca2)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-07-09 03:18:30 -07:00
Miss Islington (bot) e68978978f
bpo-40597: Allow email.contextmanager set_content() to set a null string. (GH-20542)
(cherry picked from commit 4fa61a7732)

Co-authored-by: Mark Sapiro <mark@msapiro.net>
2020-07-08 14:21:00 -07:00
Miss Islington (bot) fbd71f6684
bpo-41247: asyncio.set_running_loop() cache running loop holder (GH-21401)
The running loop holder cache variable was always set to NULL when
calling set_running_loop.

Now set_running_loop saves the newly created running loop holder in the
cache variable for faster access in get_running_loop.

Automerge-Triggered-By: @1st1
(cherry picked from commit 529f42645d)

Co-authored-by: Tony Solomonik <tony.solomonik@gmail.com>
2020-07-08 12:47:20 -07:00
Miss Islington (bot) a0a6f11678
Revert "bpo-40170: PyType_HasFeature() now always calls PyType_GetFlags() (GH-19378)" (GH-21390)
This partially reverts commit 45ec5b99ae.
(cherry picked from commit b26a0db8ea)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-07-08 02:19:38 -07:00