Commit graph

109875 commits

Author SHA1 Message Date
Miss Islington (bot)
60ba0b6847
bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916) (GH-25931)
Fixes http.client potential denial of service where it could get stuck reading lines from a malicious server after a 100 Continue response.

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

Co-authored-by: Gen Xu <xgbarry@gmail.com>
2021-05-05 16:14:28 -07:00
Miss Islington (bot)
24f1d1a8a2
bpo-43882 Remove the newline, and tab early. From query and fragments. (GH-25936)
(cherry picked from commit 985ac01637)
2021-05-05 16:04:38 -07:00
Miss Islington (bot)
3b2a45ff95
bpo-36515: Disable unaligned memory access in _sha3 on ARM (GH-25927)
Contributed-By: Matthias Klose

Automerge-Triggered-By: GH:tiran
(cherry picked from commit da5c808fb5)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2021-05-05 15:05:22 -07:00
Miss Islington (bot)
8f3ef457ad
bpo-43795: Mark PyCodec_Unregister as a function, not data, in stable ABI (GH-25920)
(cherry picked from commit cf86996a8e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2021-05-05 11:15:25 -07:00
Miss Islington (bot)
10d6f6bfd7
bpo-35753: Fix crash in doctest with unwrap-able functions (GH-22981) (#25926)
Ignore objects that inspect.unwrap throws due to
too many wrappers.  This is a very rare case, however
it can easily be surfaced when a module under doctest
imports unitest.mock.call into its namespace.

We simply skip any object that throws this exception.
This should handle the majority of cases.
(cherry picked from commit 565a31804c)

Co-authored-by: Alfred Perlstein <alfred@fb.com>
2021-05-05 20:01:21 +02:00
Miss Islington (bot)
ce4fee210b
bpo-44040: Update broken link in pathlib source (GH-25905) (GH-25910)
(cherry picked from commit 96d5c7038b)

Co-authored-by: Kevin Follstad <kfollstad@gmail.com>
2021-05-05 10:54:05 +02:00
Miss Islington (bot)
b19ec7f9df
Eliminate duplicated assignment in _randommodule.c (GH-25904) (GH-25909) 2021-05-04 21:39:09 -07:00
Miss Islington (bot)
7b4725a210
bpo-40297: Fix test_socket.CANTest.testSendFrame (GH-19548)
The address tuple for CAN_RAW no longer returns the address family
after the introduction of CAN ISO-TP support in a30f6d45ac. However,
updating test_socket.CANTest.testSendFrame was missed as part of the
change, so the test incorrectly attempts to index past the last tuple
item to retrieve the address family.

This removes the now-redundant check for equality against socket.AF_CAN,
as the tuple will not contain the address family.
(cherry picked from commit 355bae8882)

Co-authored-by: karl ding <karlding@users.noreply.github.com>
2021-05-04 14:01:42 -07:00
Miss Islington (bot)
5dffd79ee9
Clarify rx parameter of compileall functions (GH-25857)
(cherry picked from commit 09490298d4)

Co-authored-by: Jean-Abou-Samra <37271310+Jean-Abou-Samra@users.noreply.github.com>
2021-05-04 12:57:35 -07:00
Miss Islington (bot)
af14e1df37
Fix inconsistent fsum vs sum and fmean vs mean (GH-25898) (GH-25899) 2021-05-04 11:55:33 -07:00
Miss Islington (bot)
62a983d866
Fix typo in ast.py (GH-25740)
parantheses -> parentheses
(cherry picked from commit 9ee8448243)

Co-authored-by: Ikko Ashimine <eltociear@gmail.com>
2021-05-04 06:39:16 -07:00
Miss Islington (bot)
377f3d43aa
fix enum.property reference in docs (GH-25875) (#25876)
(cherry picked from commit 6fee0835cb)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-04 06:24:46 -07:00
Miss Islington (bot)
4bb0a815ef
bpo-42686: Enable SQLite math functions in Windows build (GH-24053) (#25892)
(cherry picked from commit b451bc8d7e)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
2021-05-04 15:21:40 +02:00
Miss Islington (bot)
8655521de8
bpo-32822: Add finally with return/break/continue to the tutorial (GH-25600) (#25893)
This documents in the tutorial docs the behavior of a finally clause in
case it should re-raise an exception but contains a
return/break/continue statement.
(cherry picked from commit a0b9915a8b)

Co-authored-by: Roberto Hueso <robertohueso96@gmail.com>
2021-05-04 15:17:40 +02:00
Miss Islington (bot)
31debfa524
Fix error in Enum documentation example code that was referring to the wrong enum. (GH-25837) (#25891)
(cherry picked from commit 33d9bf298b)

Co-authored-by: krisaoe <krisaoe@users.noreply.github.com>
2021-05-04 14:44:14 +02:00
Miss Islington (bot)
912ef3f248
Add C-API tests (GH-25886) (#25887)
(cherry picked from commit 2f5baa1750)

Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
2021-05-04 14:29:56 +02:00
Miss Islington (bot)
ae4f857499
bpo-44025: Clarify when '_' is a keyword. (GH-25873)
In match statements, in case patterns and nowhere else.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit 3b200b2aa6)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-05-04 04:36:50 -07:00
Miss Islington (bot)
aa0ce1615f
Copyedits to 3.10 What's New (GH-25787) (#25883)
Co-authored-by: Dominic Davis-Foster <dominic@davis-foster.co.uk>
(cherry picked from commit f6d7abc6e7)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-04 13:04:46 +02:00
Miss Islington (bot)
e1bcc88a50
bpo-38352: Add to typing.__all__ (GH-25821) (#25884)
This adds IO, TextIO, BinaryIO, Match, and Pattern.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ken Jin <28750310+Fidget-Spinner@users.noreply.github.com>
(cherry picked from commit b115579734)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-04 11:51:33 +02:00
Miss Islington (bot)
2046fb35e4
bpo-44001: improve Literal documentation (GH-25877) (#25882)
(cherry picked from commit 87109f4d85)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2021-05-04 11:17:35 +02:00
Miss Islington (bot)
20380df6d8
update docstring for win_getpass to reflect code changes (GH-24967)
The code was updated in
0ec88b33d0
but the docstring was left untouched.

=> updated the docstring to reflect the code changes
(cherry picked from commit d4222ea6b0)

Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
2021-05-04 00:08:09 -07:00
Miss Islington (bot)
2995bff426
bpo-44018: random.seed() no longer mutates its inputs (GH-25856) (GH-25872) 2021-05-03 19:45:30 -07:00
Miss Islington (bot)
d194e1eb93
fix enum and backslash warnings (GH-25861) (GH-25871)
- Enum warning in test_faulthandler
- backslash warning in test_ipaddress
(cherry picked from commit 652bcd9f9c)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2021-05-03 19:17:23 -07:00
Pablo Galindo
b86ac4c352
Add CI step to check changes in the exported ABI (GH-25868) 2021-05-04 02:15:11 +01:00
Miss Islington (bot)
d1ff838d10
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
(cherry picked from commit 9142088e74)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-03 18:07:43 -07:00
Miss Islington (bot)
756b7b9248
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
(cherry picked from commit 9142088e74)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-05-03 18:06:45 -07:00
Pablo Galindo
4d58730a3a
Update CI files to build the 3.10 branch 2021-05-04 01:47:28 +01:00
Pablo Galindo
1d320fe189
Post 3.10.0b1 2021-05-03 21:16:33 +01:00
Pablo Galindo
ba4217537c
Python 3.10.0b1 2021-05-03 20:34:56 +01:00
Shreyan Avigyan
d3b9134ebb
Remove Enum warnings from test_httpservers (GH-25844) 2021-05-03 20:27:47 +01:00
Dennis Sweeney
80a2a4ed7d
bpo-38530: Refactor and improve AttributeError suggestions (GH-25776)
- Make case-swaps half the cost of any other edit
- Refactor Levenshtein code to not use memory allocator, and to bail early on no match.
- Add comments to Levenshtein distance code
- Add test cases for Levenshtein distance behind a debug macro
- Set threshold to `(name_size + item_size + 3) * MOVE_COST / 6`.
  - Reasoning: similar to `difflib.SequenceMatcher.ratio()` >= 2/3:
```
"Multiset Jaccard similarity" >= 2/3
matching letters / total letters >= 2/3
(name_size - distance + item_size - distance) / (name_size + item_size) >= 2/3
1 - (2*distance) / (name_size + item_size) >= 2/3
1/3 >= (2*distance) / (name_size + item_size)
(name_size + item_size) / 6 >= distance
With rounding:
(name_size + item_size + 3) // 6 >= distance
```

Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2021-05-03 16:47:27 +01:00
Christian Heimes
c715b52421
bpo-43943: ssl tests: Increase server socket timeout, backlog, debugging (GH-25850)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-03 17:45:02 +02:00
Pablo Galindo
7719953b30
bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)
This reverts commit 5fb06edbbb and all
subsequent dependent commits.
2021-05-03 16:21:59 +01:00
Pablo Galindo
39494285e1
bpo-43754: Fix compiler warning in Python/compile.c (GH-25855)
This fixes the following warning:

'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data [D:\a\cpython\cpython\PCbuild\pythoncore.vcxproj]
2021-05-03 16:20:46 +01:00
Pablo Galindo
c2931d31f8
bpo-43916: Move the _PyStructSequence_InitType function to the internal API (GH-25854) 2021-05-03 15:50:24 +01:00
Julien Palard
440c025726
Doc: Fix random.uniform example comment. (GH-25784) 2021-05-03 02:20:54 -07:00
Andrew Svetlov
4ffd6fd2f1
Increase test timeout (GH-25842) 2021-05-03 12:06:17 +03:00
Batuhan Taskaya
ad106c68eb
bpo-42725: Render annotations effectless on symbol table with PEP 563 (GH-25583) 2021-05-03 10:43:00 +03:00
Christian Heimes
37ebdf0a86
bpo-44011: Fix asyncio tests without ssl module (GH-25840)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-03 09:38:56 +02:00
Eric V. Smith
99ad742ea9
bpo-44015: dataclasses should allow KW_ONLY to be specified only once per class (GH-25841)
bpo-44015: Raise a TypeError if KW_ONLY is specified more than once.
2021-05-03 03:24:53 -04:00
Eric V. Smith
72720a2639
dataclasses docs: add a missing word. (GH-25839) 2021-05-03 02:33:34 -04:00
Eric V. Smith
a21b3d2fa2
More clarification of kw_only args. (GH-25838)
Also, clarify that the dataclass decorator is what raises an error for some mutable defaults.
2021-05-03 01:55:13 -04:00
Ned Deily
c59baa02b0
Update macOS installer welcome and readme for 3.10b1 (GH-25835) 2021-05-03 01:02:13 -04:00
Ned Deily
c3bfa76221
bpo-42362: use clang name on 10.9 builds as well (GH-25834) 2021-05-03 00:23:54 -04:00
Raymond Hettinger
4ae828f3c0
Fix invalid markup (#25833) 2021-05-02 21:07:29 -07:00
Ronald Oussoren
e08059edef
bpo-42235: [macOS] Use LTO/PGO in build-installer.py with new enough compilers (GH-23079)
With recent enough compilers we can build binaries with
LTO/PGO on macOS. This patch enables this when building on
macOS 10.15 or later (Xcode 11 or later).
2021-05-02 23:43:52 -04:00
Raymond Hettinger
8c598dbb94
bpo-25478: Add total() method to collections.Counter (GH-25829) 2021-05-02 20:19:51 -07:00
Ned Batchelder
d52bbde942
bpo-41129: Fix check for macOS SDK paths when building Python (GH-25785)
Narrow search to match contents of SDKs, namely only files in ``/System/Library``,
``/System/IOSSupport``, and ``/usr`` other than ``/usr/local``. Previously,
anything under ``/System`` was assumed to be in an SDK which causes problems
with the new file system layout in 10.15+ where user file systems may appear
to be mounted under ``/System``.  Paths in ``/Library`` were also
incorrectly treated as SDK locations.

Co-authored-by: Ned Deily <nad@python.org>
2021-05-02 22:58:57 -04:00
Tal Einat
b43cc31a27
bpo-37903: IDLE: add shell sidebar mouse interactions (GH-25708)
Left click and drag to select lines.  With selection, right click for context menu with copy and copy-with-prompts.
Also add copy-with-prompts to the text-box context menu.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2021-05-02 22:27:38 -04:00
Ronald Oussoren
90d523910a
bpo-42362: Switch to clang/clang++ as the default compiler in build-installer.py (GH-23298)
This change is cosmetic only, the "gcc" command in Apple's compiler tools is an alias for "clang" (and using non-system tooling for building the installer is not supported by this script).

Automerge-Triggered-By: GH:ned-deily
2021-05-02 18:29:03 -07:00