Inada Naoki
9ad8f109ac
bpo-44029: Remove Py_UNICODE APIs (GH-25881)
...
Remove deprecated `Py_UNICODE` APIs: `PyUnicode_Encode`,
`PyUnicode_EncodeUTF7`, `PyUnicode_EncodeUTF8`,
`PyUnicode_EncodeUTF16`, `PyUnicode_EncodeUTF32`,
`PyUnicode_EncodeLatin1`, `PyUnicode_EncodeMBCS`,
`PyUnicode_EncodeDecimal`, `PyUnicode_EncodeRawUnicodeEscape`,
`PyUnicode_EncodeCharmap`, `PyUnicode_EncodeUnicodeEscape`,
`PyUnicode_TransformDecimalToASCII`, `PyUnicode_TranslateCharmap`,
`PyUnicodeEncodeError_Create`, `PyUnicodeTranslateError_Create`.
See :pep:`393` and :pep:`624` for reference.
2021-05-07 15:58:29 +09:00
Inada Naoki
4ebf4a6bfa
bpo-40943: Fix skipitem() didn't raise SystemError (GH-25937)
...
`convertitem()` raises `SystemError` when '#' is used without `PY_SSIZE_T_CLEAN`.
This commit makes `skipitem()` raise it too.
2021-05-07 11:56:48 +09:00
Stephen Rosen
fb42725561
bpo-43972: Set content-length to 0 for http.server.SimpleHTTPRequestHandler 301s (GH-25705)
...
* Set content-length for simple http server 301s
When http.server.SimpleHTTPRequestHandler sends a 301 (Moved
Permanently) due to a missing file, it does not set a Content-Length
of 0. Unfortunately, certain clients can be left waiting for the
connection to be closed in this circumstance, even though no body
will be sent. At time of writing, both curl and Firefox demonstrate
this behavior.
* Test Content-Length on simple http server redirect
When serving a redirect, the SimpleHTTPRequestHandler will now send
`Content-Length: 0`. Several tests for http.server already cover
various behaviors and checks including redirection. This change only
adds one check for the expected Content-Length on the simplest case
for a redirect.
* Add news entry for SimpleHTTPRequestHandler fix
* Clarify the specific kind of 301
Co-authored-by: Senthil Kumaran <skumaran@gatech.edu>
2021-05-06 12:25:52 -07:00
Linus Groh
329a47f052
bpo-44059: Register the SerenityOS Browser in the webbrowser module (GH-25947)
...
Automerge-Triggered-By: GH:gpshead
2021-05-06 12:01:12 -07:00
Raymond Hettinger
55b78ce3c4
Eliminate duplicated calculations and unnecessary work for linear regression (GH-25922)
2021-05-06 07:43:13 -07:00
Dong-hee Na
698e9a8211
bpo-44017: Update test_contextlib_async not to emit DeprecationWarn (GH-25918)
2021-05-06 23:10:52 +09:00
Senthil Kumaran
985ac01637
bpo-43882 Remove the newline, and tab early. From query and fragments. (GH-25921)
2021-05-05 15:50:05 -07:00
Gen Xu
47895e31b6
bpo-44022: Fix http client infinite line reading (DoS) after a HTTP 100 Continue (GH-25916)
...
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>
2021-05-05 15:42:41 -07:00
Alfred Perlstein
565a31804c
bpo-35753: Fix crash in doctest with unwrap-able functions ( #22981 )
...
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.
2021-05-05 19:33:17 +02:00
Dong-hee Na
f4013eba41
typing: format patch with make patchcheck (GH-25919)
2021-05-06 02:08:20 +09:00
Kevin Follstad
96d5c7038b
bpo-44040: Update broken link in pathlib source (GH-25905)
2021-05-05 10:08:26 +02:00
Raymond Hettinger
6fdc4d37f3
bpo-40521: Convert deque freelist from global vars to instance vars (GH-25906)
2021-05-04 17:08:31 -07:00
karl ding
355bae8882
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.
2021-05-04 15:37:13 -05:00
Raymond Hettinger
1add719516
Fix inconsistent fsum vs sum and fmean vs mean (GH-25898)
2021-05-04 11:27:28 -07:00
Ikko Ashimine
9ee8448243
Fix typo in ast.py (GH-25740)
...
parantheses -> parentheses
2021-05-04 06:18:58 -07:00
Jelle Zijlstra
b115579734
bpo-38352: Add to typing.__all__ ( #25821 )
...
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>
2021-05-04 11:29:49 +02:00
Raymond Hettinger
70a071d9e1
bpo-40465: Remove random module features deprecated in 3.9 (GH-25874)
2021-05-04 10:55:40 +02:00
Michael Felt
5017cde20e
bpo-43666: Lib/_aix_support.py routines may fail in a WPAR environment (GH-25095)
...
Since WPAR and LPAR both have a builddate for teh fileset bos.rte
The name of the fileset checked is modified.
To prevent a similiar situation (no builddate in ODM) a value
sufficient for pep425 activity if retrieved buildate is zero or NULL
Patch by M Felt.
2021-05-04 10:36:50 +02:00
Jürgen Gmach
d4222ea6b0
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
2021-05-03 23:48:29 -07:00
Ethan Furman
652bcd9f9c
fix enum and backslash warnings (GH-25861)
...
- Enum warning in test_faulthandler
- backslash warning in test_ipaddress
2021-05-03 18:44:30 -07:00
Pablo Galindo
9142088e74
bpo-43822: Prioritize tokenizer errors over custom syntax errors when raising parser exceptions (GH-25866)
2021-05-04 01:32:46 +01:00
Raymond Hettinger
b05352e4c2
bpo-44018: random.seed() no longer mutates its inputs (GH-25856)
2021-05-03 16:11:35 -07: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
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
Raymond Hettinger
8c598dbb94
bpo-25478: Add total() method to collections.Counter (GH-25829)
2021-05-02 20:19:51 -07: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
Ned Deily
8703178258
bpo-43568: Drop support for MACOSX_DEPLOYMENT_TARGET < 10.3 (GH-25827)
...
Only complain if the config target is >= 10.3 and the current target is
< 10.3. The check was originally added to ensure that incompatible
LDSHARED flags are not used, because -undefined dynamic_lookup is
used when building for 10.3 and later, and is not supported on older OS
versions. Apart from that, there should be no problem in general
with using an older target.
Authored-by: Joshua Root <jmr@macports.org>
2021-05-02 20:28:43 -04:00
Mark Shannon
33ec88ac81
bpo-43977: Make sure that tp_flags for pattern matching are inherited correctly. (GH-25813)
2021-05-03 00:38:22 +01:00
Andrew Svetlov
5fb06edbbb
bpo-44011: New asyncio ssl implementation ( #17975 )
2021-05-03 00:34:15 +03:00
Erlend Egeberg Aasland
c96cc089f6
bpo-43434: Move sqlite3.connect audit events to sqlite3.Connection.__init__ (GH-25818)
2021-05-02 22:25:17 +01:00
Jason R. Coombs
37e0c7850d
bpo-43926: Cleaner metadata with PEP 566 JSON support. (GH-25565)
...
* bpo-43926: Cleaner metadata with PEP 566 JSON support.
* Add blurb
* Add versionchanged and versionadded declarations for changes to metadata.
* Use descriptor for PEP 566
2021-05-02 17:03:40 -04:00
Brandt Bucher
0ad1e0384c
bpo-43754: Eliminate bindings for partial pattern matches (GH-25229)
2021-05-02 13:02:10 -07:00
Christian Heimes
60ce8f0be6
bpo-36384: Leading zeros in IPv4 addresses are no longer tolerated (GH-25099)
...
Reverts commit e653d4d8e8
and makes
parsing even more strict. Like socket.inet_pton() any leading zero
is now treated as invalid input.
Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-05-02 14:00:35 +02:00
Zackery Spytz
73766b0341
bpo-32745: Fix a regression in the handling of ctypes' c_wchar_p type ( #8721 )
...
Embedded nulls would cause a ValueError to be raised. Thanks go to
Eryk Sun for their analysis.
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2021-05-02 12:40:01 +02:00
Christian Heimes
91554e4c5c
bpo-43908: Mark ssl, hash, and hmac types as immutable (GH-25792)
...
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-02 09:47:45 +02:00
Inada Naoki
fd0bc7e7f4
bpo-43733: netrc try to use UTF-8 before using locale encoding. (GH-25781)
2021-05-02 14:01:02 +09:00
Ethan Furman
1ae05fdf2d
Revert "bpo-43989: Temporarily disable warnings in ssltests (GH-25780)" (GH-25793)
...
Reverts python/cpython#25780
Automerge-Triggered-By: GH:tiran
2021-05-01 13:53:57 -07:00
Christian Heimes
ddbef71a2c
bpo-43916: Rewrite new hashlib tests, fix typo (GH-25791)
...
* bpo-43916: Rewrite new hashlib tests, fix typo
* Flag test as cpython only
2021-05-01 22:42:36 +02:00
Roberto Hueso
55e5c680dd
bpo-43989: Add signal format specifier for unix_events (GH-25769)
...
Add format specifier for IntEnum references to avoid 3.12 deprecation warning.
2021-05-01 13:34:29 -07:00
Christian Heimes
a5669b3c62
bpo-43998: Fix testing without ssl module (GH-25790)
...
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-01 22:17:01 +02:00
Pablo Galindo
9a42d5069a
bpo-43957: Add a missins space to the new format enum warning ( #25770 )
2021-05-01 20:26:09 +01:00
Christian Heimes
e983252b51
bpo-43998: Default to TLS 1.2 and increase cipher suite security (GH-25778)
...
The ssl module now has more secure default settings. Ciphers without forward
secrecy or SHA-1 MAC are disabled by default. Security level 2 prohibits
weak RSA, DH, and ECC keys with less than 112 bits of security.
:class:`~ssl.SSLContext` defaults to minimum protocol version TLS 1.2.
Settings are based on Hynek Schlawack's research.
```
$ openssl version
OpenSSL 1.1.1k FIPS 25 Mar 2021
$ openssl ciphers -v '@SECLEVEL=2:ECDH+AESGCM:ECDH+CHACHA20:ECDH+AES:DHE+AES:!aNULL:!eNULL:!aDSS:!SHA1:!AESCCM'
TLS_AES_256_GCM_SHA384 TLSv1.3 Kx=any Au=any Enc=AESGCM(256) Mac=AEAD
TLS_CHACHA20_POLY1305_SHA256 TLSv1.3 Kx=any Au=any Enc=CHACHA20/POLY1305(256) Mac=AEAD
TLS_AES_128_GCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESGCM(128) Mac=AEAD
TLS_AES_128_CCM_SHA256 TLSv1.3 Kx=any Au=any Enc=AESCCM(128) Mac=AEAD
ECDHE-ECDSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(256) Mac=AEAD
ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(256) Mac=AEAD
ECDHE-ECDSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AESGCM(128) Mac=AEAD
ECDHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AESGCM(128) Mac=AEAD
ECDHE-ECDSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=ECDSA Enc=CHACHA20/POLY1305(256) Mac=AEAD
ECDHE-RSA-CHACHA20-POLY1305 TLSv1.2 Kx=ECDH Au=RSA Enc=CHACHA20/POLY1305(256) Mac=AEAD
ECDHE-ECDSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(256) Mac=SHA384
ECDHE-RSA-AES256-SHA384 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(256) Mac=SHA384
ECDHE-ECDSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=ECDSA Enc=AES(128) Mac=SHA256
ECDHE-RSA-AES128-SHA256 TLSv1.2 Kx=ECDH Au=RSA Enc=AES(128) Mac=SHA256
DHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(256) Mac=AEAD
DHE-RSA-AES128-GCM-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AESGCM(128) Mac=AEAD
DHE-RSA-AES256-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(256) Mac=SHA256
DHE-RSA-AES128-SHA256 TLSv1.2 Kx=DH Au=RSA Enc=AES(128) Mac=SHA256
```
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-01 20:53:10 +02:00
Eric V. Smith
823fbf4e0e
If using a frozen class with slots, add __getstate__ and __setstate__ to set the instance values. (GH-25786)
2021-05-01 13:27:30 -04:00
Christian Heimes
f82fd77717
bpo-43989: Temporarily disable warnings in ssltests (GH-25780)
...
-Werror is currently broken.
2021-05-01 16:05:01 +02:00