Commit graph

108296 commits

Author SHA1 Message Date
Antoine Pitrou
ac17ed60f2
[3.9] bpo-43517: Fix false positive in detection of circular imports (GH-24895) (GH-24948)
(cherry picked from commit 2fd16ef406)

Co-authored-by: Antoine Pitrou <antoine@python.org>

Automerge-Triggered-By: GH:pitrou
2021-03-20 12:40:18 -07:00
Miss Islington (bot)
e8e341993e
bpo-43521: Allow ast.unparse with empty sets and NaN (GH-24897)
Automerge-Triggered-By: GH:pablogsal
(cherry picked from commit 08ff4369af)

Co-authored-by: Kodi Arfer <Kodiologist@users.noreply.github.com>
2021-03-18 15:51:47 -07:00
Miss Islington (bot)
3365e684a8
bpo-41561: Add workaround for Ubuntu's custom security level (GH-24915)
Ubuntu 20.04 comes with a patched OpenSSL 1.1.1. Default security level
2 blocks TLS 1.0 and 1.1 connections. Regular OpenSSL 1.1.1 builds allow
TLS 1.0 and 1.1 on security level 2.

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

Co-authored-by: Christian Heimes <christian@python.org>
2021-03-18 15:31:34 -07:00
Miss Islington (bot)
4cc9e2348b
Add a warning block around the get_referrers() documentation (GH-24511)
(cherry picked from commit 813db24f7c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-03-17 17:26:07 -07:00
Miss Islington (bot)
aa967ec4d4
bpo-35883: Py_DecodeLocale() escapes invalid Unicode characters (GH-24843)
Python no longer fails at startup with a fatal error if a command
line argument contains an invalid Unicode character.

The Py_DecodeLocale() function now escapes byte sequences which would
be decoded as Unicode characters outside the [U+0000; U+10ffff]
range.

Use MAX_UNICODE constant in unicodeobject.c.
(cherry picked from commit 9976834f80)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-03-17 14:11:14 -07:00
Ammar Askar
db73376106
[3.9] bpo-43499: Restrict co_code to be under INT_MAX in codeobject (GH-20628) (GH-24896)
(cherry picked from commit 3b3b83c965)
2021-03-17 20:26:38 +02:00
Miss Islington (bot)
1f0cde6784
bpo-41654: Fix compiler warning in MemoryError_dealloc() (GH-22387) (GH-24894)
Fix warning:

Objects\exceptions.c(2324,56): warning C4098:
'MemoryError_dealloc': 'void' function returning a value
(cherry picked from commit bbeb223e9a)

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

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-03-16 18:36:41 +01:00
Serhiy Storchaka
651fc30af7
bpo-43499: Silence compiler warnings about using legacy C API on Windows (GH-24873) 2021-03-16 08:03:37 +02:00
Miss Islington (bot)
a838e477a0
bpo-43506: Doc: Update removal schedule for Py_UNICODE encoder APIs (GH-24885)
See PEP 624.
(cherry picked from commit 1330338583)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-03-15 21:48:12 -07:00
Gregory P. Smith
d0312cece9
[3.9] bpo-43285: Add a What's New entry for 3.9.3. (GH-24888)
Covers the ftplib security fix.
2021-03-15 21:37:58 -07:00
Miss Islington (bot)
7dcb4baa4f
bpo-43285 Make ftplib not trust the PASV response. (GH-24838)
bpo-43285: Make ftplib not trust the PASV response.

The IPv4 address value returned from the server in response to the PASV command
should not be trusted.  This prevents a malicious FTP server from using the
response to probe IPv4 address and port combinations on the client network.

Instead of using the returned address, we use the IP address we're
already connected to.  This is the strategy other ftp clients adopted,
and matches the only strategy available for the modern IPv6 EPSV command
where the server response must return a port number and nothing else.

For the rare user who _wants_ this ugly behavior, set a `trust_server_pasv_ipv4_address`
attribute on your `ftplib.FTP` instance to True.
(cherry picked from commit 0ab152c6b5)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-03-15 12:02:45 -07:00
Miss Islington (bot)
83f676092e
Fix typo in the word "spaghetti" (GH-24866)
Automerge-Triggered-By: GH:Mariatta
(cherry picked from commit 93d33b47af)

Co-authored-by: Kazantcev Andrey <45011689+heckad@users.noreply.github.com>
2021-03-15 10:45:04 -07:00
Miss Islington (bot)
2fe408497e
[3.9] [doc] Document logging.basicConfig default format (GH-23710) (GH-24835)
(cherry picked from commit 35cacce525)
2021-03-15 09:41:00 +00:00
Miss Islington (bot)
c3f03333c3
bpo-43199: Briefly explain why no goto (GH-24852)
Answer "Why is there no goto?" in the Design and History FAQ.
(cherry picked from commit 5e29021a5e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-03-14 21:21:36 -07:00
Miss Islington (bot)
cf8d6ef962
bpo-39943: Fix MSVC warnings in sre extension (GH-20508)
(cherry picked from commit 06e3a27a3c)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2021-03-14 05:17:26 -07:00
Pablo Galindo
e6bf1e1001
[3.9] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836) (GH-24855)
* [3.9] bpo-43439: Wrapt the tuple in the audit events for the gc module (GH-24836).
(cherry picked from commit 9c376bc1c4)

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

* Update gcmodule.c

* Update gcmodule.c

* Update gcmodule.c
2021-03-14 05:28:37 +00:00
Miss Islington (bot)
45d9c8cda3
bpo-43427: Separte the method overview from the static method specifics. (GH-24787) (GH-24849) 2021-03-13 18:31:33 -08:00
Miss Islington (bot)
bb46c135ad
Fix typos in unittest documentation (GH-24194)
* addCleanupClass  -> addClassCleanup
* doCleanupsClass -> doClassCleanups
(cherry picked from commit e0e398ef18)

Co-authored-by: Conchylicultor <etiennefg.pot@gmail.com>
2021-03-13 16:27:53 -08:00
Miss Islington (bot)
53ab4af444
Update client.py (GH-24827)
(cherry picked from commit b6884ad268)

Co-authored-by: Géry Ogam <gery.ogam@gmail.com>
2021-03-13 04:44:36 -08:00
Miss Islington (bot)
5c674e4479
Update link to Django's Context class. (GH-24805) (#24841)
* Update link to Django's Context class.
* Update link to get-pip.py.
(cherry picked from commit d0a445490e)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2021-03-13 04:34:46 -08:00
Miss Islington (bot)
32717b982d
bpo-27820: Fix AUTH LOGIN logic in smtplib.SMTP (GH-24118) (#24832)
* Fix auth_login logic (bpo-27820)

* Also fix a longstanding bug in the SimSMTPChannel.found_terminator() method that causes inability to test
SMTP AUTH with initial_response_ok=False.
(cherry picked from commit 7591d9455e)

Co-authored-by: Pandu E POLUAN <pepoluan@gmail.com>
2021-03-12 16:15:23 -08:00
Mariusz Felisiak
4d7f11e057
[3.9] bpo-43353: Document that logging.getLevelName() accepts string representation of logging level. (GH-24693) (GH-24826)
(cherry picked from commit bbba28212c)

Automerge-Triggered-By: GH:vsajip
2021-03-12 00:46:07 -08:00
Miss Islington (bot)
ad83fde754
bpo-43423 Fix IndexError in subprocess _communicate function (GH-24777)
Check to make sure stdout and stderr are not empty before selecting an item from them in Windows subprocess._communicate.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
(cherry picked from commit b4fc44bb2d)

Co-authored-by: Chris Griffith <chris@cdgriffith.com>
2021-03-11 17:56:35 -08:00
Miss Islington (bot)
531f2ebd60
bpo-43406: Fix test_signal.test_stress_modifying_handlers() (GH-24815) (GH-24817)
Fix a race condition of test_stress_modifying_handlers() of
test_signal: only raise signals while we are in the
catch_unraisable_exception() context manager.
Moreover, don't check if we received at least one
signal if at least one signal got ignored.
(cherry picked from commit 1fa17e8cc6)

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

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-03-10 16:10:57 +01:00
Pablo Galindo
f814675376
[3.9] bpo-43439: Add audit hooks for gc functions (GH-24794). (GH-24811)
(cherry picked from commit b4f9089d4a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-03-10 00:50:29 -08:00
Miss Islington (bot)
da602560a4
bpo-43446: Fix markup in sqlite3 footnote (GH-24806)
(cherry picked from commit 62a03cd490)

Co-authored-by: Kamil Turek <kamil.turek@hotmail.com>
2021-03-10 01:43:17 +02:00
Miss Islington (bot)
ea46c7bc50
bpo-3329: Fix typo in PyObjectArenaAllocator doc (GH-24795)
(cherry picked from commit 0d6bd1ca7c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-03-09 03:39:39 -08:00
Miss Islington (bot)
fb3b031030
bpo-43415: Fix typo on dataclasses.rst (GH-24789) (GH-24790)
(cherry picked from commit 0554044ddc)

Co-authored-by: Guilherme Martins Crocetti <gmcrocetti@gmail.com>

Co-authored-by: Guilherme Martins Crocetti <gmcrocetti@gmail.com>
2021-03-08 17:52:43 -05:00
Miss Islington (bot)
c6e7cf1ee0
bpo-43332: Buffer proxy connection setup packets before sending. (GH-24780)
We now buffer the CONNECT request + tunnel HTTP headers into a single
send call.  This prevents the OS from generating multiple network
packets for connection setup when not necessary, improving efficiency.
(cherry picked from commit c25910a135)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-03-07 23:59:37 -08:00
Miss Islington (bot)
2c0a0b04a4
Put contextvars docs into the concurrency category (GH-24760)
(cherry picked from commit 5eb7796b7f)

Co-authored-by: Brett Cannon <brett@python.org>
2021-03-06 08:48:12 -08:00
Miss Islington (bot)
1385f8355a
[3.9] bpo-43406: Fix possible race condition where `PyErr_CheckSignals` tries to execute a non-Python signal handler (GH-24756) (GH-24761)
We can receive signals (at the C level, in `trip_signal()` in signalmodule.c) while `signal.signal` is being called to modify the corresponding handler.  Later when `PyErr_CheckSignals()` is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception.
(cherry picked from commit 68245b7a10)


Co-authored-by: Antoine Pitrou <antoine@python.org>
2021-03-06 07:07:46 -08:00
Miss Islington (bot)
65f3a0d20c
bpo-43407: Clarify comparisons of time.monotonic() et al results (GH-24757)
Previous wording implied that only the result of call N and N+1 could be
meaningfully compared, whereas comparing call N and N+M is fine.
(cherry picked from commit ff5f05934d)

Co-authored-by: Alex Willmer <alex@moreati.org.uk>
2021-03-05 17:48:33 -08:00
Miss Islington (bot)
0dd4cb944b
bpo-43400: Remove "easy to use" from mock docs (GH-24752) (GH-24758) 2021-03-04 16:35:43 -08:00
Miss Islington (bot)
374ee44933
bpo-43396: Normalise naming in sqlite3 doc examples (GH-24746)
(cherry picked from commit 40d1b831ec)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-03-04 19:11:40 +02:00
Miss Islington (bot)
0e76157b0c
[3.9] bpo-37193: Remove thread objects which finished process its request (GH-23127) (GH-24750)
This reverts commit aca67da4fe.
(cherry picked from commit b5711c940f)


Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

Automerge-Triggered-By: GH:jaraco
2021-03-04 08:36:41 -08:00
Miss Islington (bot)
ff6a021c25
Add an attribution to the Green Tree Snakes in the AST docs (GH-24727)
(cherry picked from commit 62e3b6370c)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-03-03 10:48:56 -08:00
Senthil Kumaran
bf566847f5
[3.9] bpo-42782: Fail fast for permission errors in shutil.move() (GH-24001) (#24725)
* Fail fast in shutil.move() to avoid creating destination directories on failure.

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
(cherry picked from commit 132131b404)

Co-authored-by: Winson Luk <winson.luk@gmail.com>

Co-authored-by: Winson Luk <winson.luk@gmail.com>
2021-03-03 08:04:00 -08:00
Miss Islington (bot)
024325db58
Pin test runner to Ubuntu 18 to un-break CI (GH-24715)
(cherry picked from commit 94894dd45e)

Co-authored-by: Brandt Bucher <brandt@python.org>
2021-03-03 01:56:36 -08:00
Mark Shannon
8b795ab554
bpo-42500: Fix recursion in or after except (GH-23568) (#24501)
* Use counter, rather boolean state when handling soft overflows.

(cherry picked from commit 4e7a69bdb6)
2021-03-02 11:36:38 +01:00
Miss Islington (bot)
f836e5f219
Doc: Improve library/json document. (GH-24390)
(cherry picked from commit a347bc0b35)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
2021-03-01 18:15:05 -08:00
Miss Islington (bot)
ff887f38f6
Fixed linenumber missing when audit hook has an error (GH-24692)
See https://github.com/sphinx-doc/sphinx/issues/8932

Co-authored-by: tk0miya <i.tkomiya@gmail.com>
(cherry picked from commit dbfabcc0c3)

Co-authored-by: Jules Lasne <jules.lasne@gmail.com>
2021-03-01 14:23:21 -08:00
Miss Islington (bot)
4f9eb3f3d3
Fix grammar in enum documentation. (GH-24689)
There is an extra `s` in the singular word `method`.
Reported in docs mailing list by Steven Nguyen.

Automerge-Triggered-By: GH:Mariatta
(cherry picked from commit f193874056)

Co-authored-by: Mariatta Wijaya <Mariatta@users.noreply.github.com>
2021-03-01 11:21:05 -08:00
Miss Islington (bot)
982e8ecbdf
bpo-41837: Update macOS installer build to use OpenSSL 1.1.1j. (GH-24677)
(cherry picked from commit 0242494a15)

Co-authored-by: Ned Deily <nad@python.org>
2021-03-01 00:01:43 -08:00
Miss Islington (bot)
132e31f4bf
bpo-43335: Update macro to check gcc version (GH-24662)
(cherry picked from commit bf9de7ab24)

Co-authored-by: Dong-hee Na <donghee.na@python.org>
2021-02-27 16:51:36 -08:00
Miss Islington (bot)
6c4c11763f
bpo-43144: Mark unicodedata's test_normalization as requiring network (GH-24650)
Co-authored-by: Arkadiusz Miśkiewicz <arekm@maven.pl>
(cherry picked from commit c6ccdfb479)

Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
2021-02-25 21:44:17 -08:00
Miss Islington (bot)
540749ed6d
bpo-43316: gzip: Fix sys.exit() usage. (GH-24652)
(cherry picked from commit 9525a18b5b)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2021-02-25 18:36:27 -08:00
Miss Islington (bot)
adea9b86a9
bpo-43316: gzip: CLI uses non-zero return code on error. (GH-24647)
Exit code is now 1 instead of 0. A message is printed to stderr instead of stdout. This is
the proper behaviour for a tool that can be used in scripts.
(cherry picked from commit cc3df6368d)

Co-authored-by: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
2021-02-26 10:13:17 +09:00
Miss Islington (bot)
f82578ace1
bpo-43293: Doc: move note about GIL to top of threading module (GH-24622)
The note about the GIL was buried pretty deep in the threading documentation,
and this made it hard for first time users to discover why their attempts
at using threading to parallelizing their application did not work.

In this commit, the note is moved to the top of the module documention for
visibility.
(cherry picked from commit 32181be608)

Co-authored-by: Guanzhong Chen <quantum2048@gmail.com>
2021-02-24 11:01:33 -08:00
Terry Jan Reedy
d81a20454e
[3.9] bpo-41841: revise header (GH-24634) 2021-02-23 21:32:20 -05:00
Miss Islington (bot)
e202f1e4db
bpo-43283: Add IDLE doc paragraph about print speed (GH-24615)
Printing to IDLE's Shell is often slower than printing to a system
terminal, but it can be made faster by pre-formatting a single
string before printing.
(cherry picked from commit 2827e8a177)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-02-23 17:03:37 -08:00