Commit Graph

23704 Commits

Author SHA1 Message Date
Miss Skeleton (bot) 6a2aa4994e
bpo-42065: Fix incorrectly formatted _codecs.charmap_decode error message (GH-19940)
(cherry picked from commit 3635388f52)

Co-authored-by: Max Bernstein <tekknolagi@users.noreply.github.com>
2020-10-18 09:00:18 +03:00
Miss Skeleton (bot) d197b2bb3e
bpo-41984: GC track all user classes (GH-22701/GH-22702)
(cherry picked from commit c13b847a6f)
2020-10-14 20:38:25 -07:00
Miss Skeleton (bot) f07448bef4
bpo-41894: Fix UnicodeDecodeError while loading native module (GH-22466)
When running in a non-UTF-8 locale, if an error occurs while importing a
native Python module (say because a dependent share library is missing),
the error message string returned may contain non-ASCII code points
causing a UnicodeDecodeError.

PyUnicode_DecodeFSDefault is used for buffers which may contain
filesystem  paths. For consistency with os.strerror(),
PyUnicode_DecodeLocale is used for buffers which contain system error
messages. While the shortname parameter is always encoded in ASCII
according to PEP 489, it is left decoded using PyUnicode_FromString to
minimize the changes and since it should not affect the decoding (albeit
_potentially_ slower).

In dynload_hpux, since the error buffer contains a message generated
from a static ASCII string and the module filesystem path,
PyUnicode_DecodeFSDefault is used instead of PyUnicode_DecodeLocale as
is used elsewhere.

* bpo-41894: Fix bugs in dynload error msg handling

For both dynload_aix and dynload_hpux, properly handle the possibility
that decoding strings may return NULL and when such an error happens,
properly decrement any previously decoded strings and return early.

In addition, in dynload_aix, ensure that we pass the decoded string
*object* pathname_ob to PyErr_SetImportError instead of the original
pathname buffer.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 2d2af320d9)

Co-authored-by: Kevin Adler <kadler@us.ibm.com>
2020-10-14 19:25:45 -07:00
Miss Skeleton (bot) 391a544f2a
bpo-41993: Fix possible issues in remove_module() (GH-22631) (GH-22647)
* PyMapping_HasKey() is not safe because it silences all exceptions and can return incorrect result.
* Informative exceptions from PyMapping_DelItem() are overridden with RuntimeError and
  the original exception raised before calling remove_module() is lost.
* There is a race condition between PyMapping_HasKey() and PyMapping_DelItem().
(cherry picked from commit 8287aadb75)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-10-14 12:09:44 +03:00
Miss Skeleton (bot) 8a12503b45
bpo-42015: Reorder dereferencing calls in meth_dealloc, to make sure m_self is kept alive long enough (GH-22670)
(cherry picked from commit 04b8631d84)

Co-authored-by: Yannick Jadoul <yannick.jadoul@belgacom.net>
2020-10-12 14:29:01 -07:00
Victor Stinner f5393dc2a0
bpo-41739: Fix test_logging.test_race_between_set_target_and_flush() (GH-22655) (GH-22656)
The test now waits until all threads complete to avoid leaking
running threads.

Also, use regular threads rather than daemon threads.

(cherry picked from commit 13ff396c01)
2020-10-12 05:30:48 +01:00
Miss Skeleton (bot) ebc5a6b59e
bpo-41986: Add Py_FileSystemDefaultEncodeErrors and Py_UTF8Mode back to limited API (GH-22621)
(cherry picked from commit 637a09b0d6)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-10-10 07:32:09 -07:00
Miss Skeleton (bot) 1f75fc7a9d
bpo-41831: Restore str implementation of __str__ in tkinter.EventType (GH-22355)
(cherry picked from commit eb38c6b7aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-10-09 13:20:48 -07:00
Batuhan Taskaya 42157b9eaa
[3.9] bpo-41979: Accept star-unpacking on with-item targets (GH-22611) (GH-22612)
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>

Automerge-Triggered-By: @pablogsal
2020-10-09 03:31:07 -07:00
Karthikeyan Singaravelan c6f41e62f5
[3.9] bpo-41970: Avoid test failure in test_lib2to3 if the module is already imported (GH-22595) (GH-22609)
(cherry picked from commit 4a9f82f50d)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-10-09 11:08:42 +01:00
Miss Skeleton (bot) 089c38677d
bpo-41557: Update Windows installer to use SQLite 3.33.0 (GH-21960)
(cherry picked from commit bfe6e03cd6)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-10-08 12:02:33 -07:00
Miss Skeleton (bot) a4ac5fadf5
bpo-41976: Fix the fallback to gcc of ctypes.util.find_library when using gcc>9 (GH-22598)
(cherry picked from commit 27ac19cca2)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-10-08 11:55:24 -07:00
Miss Skeleton (bot) 15e091f63f
bpo-41306: Allow scale value to not be rounded (GH-21715)
This fixes the test failure with Tk 6.8.10 which is caused by changes to how Tk rounds the `from`, `to` and `tickinterval` arguments. This PR uses `noconv` if the patchlevel is greater than or equal to 8.6.10 (credit to Serhiy for this idea as it is much simpler than what I previously proposed).

Going into more detail for those who want it, the Tk change was made in [commit 591f68c](591f68cb38) and means that the arguments listed above are rounded relative to the value of `from`. However, when rounding the `from` argument ([line 623](591f68cb38/generic/tkScale.cGH-L623)), it is rounded relative to itself (i.e. rounding `0`) and therefore the assigned value for `from` is always what is given (no matter what values of `from` and `resolution`).

Automerge-Triggered-By: @pablogsal
(cherry picked from commit aecf036738)

Co-authored-by: E-Paine <63801254+E-Paine@users.noreply.github.com>
2020-10-08 09:50:36 -07:00
Miss Skeleton (bot) b664a1df4e
bpo-41944: No longer call eval() on content received via HTTP in the CJK codec tests (GH-22566)
(cherry picked from commit 2ef5caa58f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-10-06 05:37:36 -07:00
Miss Skeleton (bot) 10b4136bfa
bpo-41939: Fix test_site.test_license_exists_at_url() (GH-22559) (#22567)
Call urllib.request.urlcleanup() to reset the global
urllib.request._opener.
(cherry picked from commit 1fce240d6c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-10-05 18:49:41 +02:00
Łukasz Langa 79dd0dbc32 Python 3.9.0
-----BEGIN PGP SIGNATURE-----
 
 iQIzBAABCAAdFiEE4/8oOcBIslwITevpsmmV4xAlBWgFAl97Nt8ACgkQsmmV4xAl
 BWhFGA//cXN7hkXzURCN2z7GCHaAUm/jnJ+7xta8oVlSjpJT0OjJsxojnc+XpQau
 2bCW2o3uxhiM6qr7N2V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dS6rqVR5o38lOGty5/e6pf10PA+9mfLv1n9IATdsE/T9uTV0WICYojcyb
 GixtJZZRysoCPUBQSJvtrBLHQOsb0XiT+b+3aV9XpfPxDfgqiVRdAYN7IUs1vZXU
 I/4l2gq1dlskj+/SG/O/bakBFzOvXqSl4ZYyg7NZd5vseddDQ9emBbJJMGoJnFmM
 Iq7RFM7tuwLwjuz2tMuDOpD3ZZJ4lCOjRWHL1ruI8kpwd8KLb+lsT1FBu7ZSRI9P
 unIzdPAZVg6yIk+aUYNVKmQccNdKab89BfLQU0aRMh2QCY7WYF38Kh3QrEJ2ttKj
 m5ar2DCVd+2qPefLJsoSpwvv0IAOrBHYerVBRLx+idFQaleHJh5y2QSEtBie6NM1
 lVXBBrSoag==
 =cYzo
 -----END PGP SIGNATURE-----

Merge tag 'v3.9.0' into 3.9

Python 3.9.0
2020-10-05 18:05:58 +02:00
Łukasz Langa 9cf6752276
Python 3.9.0 2020-10-05 17:07:58 +02:00
Miss Skeleton (bot) b6d37e15cf
bpo-41557: Update macOS installer to use SQLite 3.33.0 (GH-21959) (GH-22560)
(cherry picked from commit 9a7642667a)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2020-10-05 05:01:51 -04:00
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+oFjAX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 -----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