Commit Graph

116900 Commits

Author SHA1 Message Date
JohnJamesUtley 29f348e232
gh-103848: Adds checks to ensure that bracketed hosts found by urlsplit are of IPv6 or IPvFuture format (#103849)
* Adds checks to ensure that bracketed hosts found by urlsplit are of IPv6 or IPvFuture format

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-05-10 00:18:35 +00:00
Jakub Kulík 2c863b3871
gh-74895: adjust tests to work on Solaris (#104326)
Solaris is unusual here, but apparently everyone is happy when SOCK_STREAM is explicitly specified.
2023-05-09 16:49:55 -07:00
Erlend E. Aasland 235b82721d
gh-101819: Refactor _io in preparation for module isolation (#104334)
- Replace query with parameter in bufferediobase_unsupported()
- Replace query with parameter in iobase_unsupported()
- Hide delegate: Add method wrapper for _PyIOBase_check_seekable
- Hide delegate: Add method wraper for _PyIOBase_check_readable
- Hide delegate: Add method wraper for _PyIOBase_check_writable
- Replace query with parameter in _PyIOBase_check_seekable()
- Replace query with parameter in _PyIOBase_check_readable()
- Replace query with parameter in _PyIOBase_check_writable()
2023-05-09 23:09:03 +00:00
Alex Waygood fe694a6db6
gh-90953: Don't use deprecated AST nodes in clinic.py (#104322) 2023-05-09 22:16:22 +01:00
David Foster 7ba6288feb
gh-102327: Extend docs for "url" and "headers" parameters to HTTPConnection.request()
Added example on how to use the HTTPConnection object for making GET request.

Original issue: https://github.com/python/cpython/issues/102327

---------

Co-authored-by: Éric <earaujo@caravan.coop>
2023-05-09 12:57:17 -07:00
Kirill Podoprigora 01c321ca34
gh-104328: Fix typo in ``typing.Generic`` multiple inheritance error message (#104335) 2023-05-09 13:18:15 -06:00
Jacob Bower 2866e030f0
gh-97696 Add documentation for get_coro() behavior with eager tasks (#104304) 2023-05-09 10:09:16 -07:00
Carl Meyer c3b595e73e
gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-05-09 11:02:14 -06:00
Sam Carroll 0aeda29793
gh-99889: Fix directory traversal security flaw in uu.decode() (#104096)
* Fix directory traversal security flaw in uu.decode()
* also check absolute paths and os.altsep
* Add a regression test.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
2023-05-09 16:01:58 +00:00
Carl Meyer afe7703744
gh-104184: fix building --with-pydebug --enable-pystats (#104217) 2023-05-09 08:53:19 -06:00
Gregory P. Smith 82f789be3b
gh-104139: Add itms-services to uses_netloc urllib.parse. (#104312)
Teach unsplit to retain the `"//"` when assembling `itms-services://?action=generate-bugs` style
[Apple Platform Deployment](https://support.apple.com/en-gb/guide/deployment/depce7cefc4d/web) URLs.
2023-05-09 07:04:50 -07:00
Irit Katriel ca95edf177
gh-104240: return code unit metadata from codegen (#104300) 2023-05-09 14:33:40 +01:00
chgnrdv c21f828760
gh-104276: Make `_struct.unpack_iterator` type use type flag instead of custom constructor (#104277) 2023-05-09 12:41:09 +00:00
Itamar Ostricher 85f981880a
gh-97696: Move around and update the whatsnew entry for asyncio eager task factory (#104298) 2023-05-09 12:39:59 +00:00
Alex Waygood 9196da417d
gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320) 2023-05-09 18:03:36 +05:30
Sebastian Pipping 41aff464ce
require-pr-label.yml: Add missing "permissions:" (#104309) 2023-05-09 13:29:00 +03:00
Zhang Na 03029ace92
gh-90656: Add platform triplets for 64-bit LoongArch (LA64) (#30939)
Signed-off-by: Zhang Na <zhangna@loongson.cn>
Co-authored-by: WANG Xuerui <git@xen0n.name>
2023-05-09 09:19:40 +00:00
samschott 9a9b176eb7
gh-104180: Read SOCKS proxies from macOS System Configuration (#104181)
read SOCKS proxies from macOS System Configuration in ``urllib.request``.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-05-09 10:24:29 +02:00
Jacob Bower bf89d4283a
gh-97696 Remove unnecessary check for eager_start kwarg (#104188)
Instead, add docstring to create_eager_task_factory.
2023-05-09 00:51:58 +00:00
Nathaniel J. Smith faf196213e
GH-104308: socket.getnameinfo should release the GIL (#104307)
* socket.getnameinfo should release the GIL

* 📜🤖 Added by blurb_it.

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-05-08 16:27:20 -07:00
Eric Snow 4541d1a0db
gh-104310: Add importlib.util.allowing_all_extensions() (gh-104311)
(I'll be adding docs for this separately.)
2023-05-08 16:56:01 -06:00
Eric Snow 5c9ee498c6
gh-99113: A Per-Interpreter GIL! (gh-104210)
This is the culmination of PEP 684 (and of my 8-year long multi-core Python project)!

Each subinterpreter may now be created with its own GIL (via Py_NewInterpreterFromConfig()).  If not so configured then the interpreter will share with the main interpreter--the status quo since subinterpreters were added decades ago.  The main interpreter always has its own GIL and subinterpreters from Py_NewInterpreter() will always share with the main interpreter.
2023-05-08 13:15:09 -06:00
Adam Turner 942482c8e6
GH-104284: Fix documentation gettext build (#104296) 2023-05-08 19:01:25 +00:00
Arjun 9af485436b
gh-89550: Buffer GzipFile.write to reduce execution time by ~15% (#101251)
Use `io.BufferedWriter` to buffer gzip writes.

---------

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-05-08 17:55:59 +00:00
Jelle Zijlstra 405eacc1b8
gh-104223: Fix issues with inheriting from buffer classes (#104227)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2023-05-08 09:52:41 -07:00
Jonathan Protzenko 874010c6ca
gh-99108: fix typo in Modules/Setup (#104293)
case sensitive filename
2023-05-08 09:52:11 -07:00
Adam Turner 76eef552f3
GH-104145: Use fully-qualified cross reference types for the bisect module (#104172) 2023-05-08 17:32:18 +01:00
Alex Waygood 921185ed05
gh-103193: Improve `getattr_static` test coverage (#104286) 2023-05-08 15:18:36 +01:00
Hugo van Kemenade d513ddee94
Trim trailing whitespace and test on CI (#104275)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-05-08 17:03:52 +03:00
Shantanu 1f5679540c
gh-102500: Remove mention of bytes shorthand (#104281)
The bytes shorthand was removed in PEP 688:
https://peps.python.org/pep-0688/#no-special-meaning-for-bytes

I also remove the reference to `collections.abc.ByteString`, since that
object is deprecated (#91896) and has different semantics (#102092)
2023-05-08 14:40:51 +01:00
Itamar Ostricher c2683fc46d
gh-97696: Improve and fix documentation for asyncio eager tasks (#104256) 2023-05-08 17:29:34 +05:30
Jonathan Protzenko 15665d896b
gh-99108: Replace SHA3 implementation HACL* version (#103597)
Replaces our built-in SHA3 implementation with a verified one from the HACL* project.

This implementation is used when OpenSSL does not provide SHA3 or is not present.

3.11 shiped with a very slow tiny sha3 implementation to get off of the <=3.10 reference implementation that wound up having serious bugs. This brings us back to a reasonably performing built-in implementation consistent with what we've just replaced our other guaranteed available standard hash algorithms with: code from the HACL* project.

---------

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-05-07 20:50:04 -07:00
Burak Saler 01cc9c1ff7
gh-104273: Remove redundant len() calls in argparse function (#104274) 2023-05-07 19:43:50 -04:00
Erlend E. Aasland ac020624b3
gh-64660: Don't hardcode Argument Clinic return converter result variable name (#104200) 2023-05-07 21:55:37 +00:00
chgnrdv 06c2a4858b
gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` (#104266) 2023-05-07 21:15:44 +00:00
Barney Gale c0ece3dc97
GH-102613: Improve performance of `pathlib.Path.rglob()` (GH-104244)
Stop de-duplicating results in `_RecursiveWildcardSelector`. A new
`_DoubleRecursiveWildcardSelector` class is introduced which performs
de-duplication, but this is used _only_ for patterns with multiple
non-adjacent `**` segments, such as `path.glob('**/foo/**')`. By avoiding
the use of a set, `PurePath.__hash__()` is not called, and so paths do not
need to be stringified and case-normalised.

Also merge adjacent '**' segments in patterns.
2023-05-07 22:12:50 +01:00
Arthur Pastel 8d95012c95
gh-103650: Fix perf maps address format (#103651) 2023-05-07 20:42:26 +01:00
Barney Gale e8d77b03e0
GH-89812: Churn `pathlib.Path` methods (GH-104243)
Re-arrange `pathlib.Path` methods in source code. No other changes.

The methods are arranged as follows:

1. `stat()` and dependants (`exists()`, `is_dir()`, etc)
2. `open()` and dependants (`read_text()`, `write_bytes()`, etc)
3. `iterdir()` and dependants (`glob()`, `walk()`, etc)
4. All other `Path` methods

This patch prepares the ground for a new `_AbstractPath` class, which will
support the methods in groups 1, 2 and 3 above. By churning the methods
here, subsequent patches will be easier to review and less likely to break
things.
2023-05-07 20:07:07 +01:00
Irit Katriel 2c2dc61e8d
gh-104240: make _PyCompile_CodeGen support different compilation modes (#104241) 2023-05-07 18:47:28 +01:00
Alex Waygood 1b19bd1a88
gh-103193: cache calls to `inspect._shadowed_dict` in `inspect.getattr_static` (#104267)
Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-05-07 18:45:09 +01:00
Barney Gale 60f588478f
GH-100479: Fix pathlib test failure on WASI (#104215) 2023-05-07 17:54:40 +01:00
Erlend E. Aasland 7a7eaff95c
gh-101819: Port _io.PyBytesIOBuffer_Type to heap type (#104264) 2023-05-07 14:01:27 +00:00
Erlend E. Aasland a05bad3254
gh-100370: fix OverflowError in sqlite3.Connection.blobopen for 32-bit builds (#103902) 2023-05-07 12:55:31 +02:00
Erlend E. Aasland cab1298a60
gh-101819: Adapt _io.PyWindowsConsoleIO_Type to heap type (#104197) 2023-05-07 11:23:11 +02:00
Erlend E. Aasland 3952379655
gh-101819: Port _io.PyIncrementalNewlineDecoder_Type to heap type (#104249) 2023-05-07 11:20:34 +02:00
ymki4360 472938316a
Re-enable commented-out test in test_generators.py (#104130) 2023-05-07 10:14:46 +05:30
John Belmonte 69621d1b09
gh-104018: remove unused format "z" handling in string formatfloat() (#104107)
This is a cleanup overlooked in PR #104033.
2023-05-07 10:11:42 +05:30
Itamar Ostricher c53547c907
gh-97696: Use `PyObject_CallMethodNoArgs` and inline is_loop_running check in `_asyncio` (#104255) 2023-05-07 09:55:45 +05:30
Tomas R b35711d17a
gh-103886: Improve `builtins.__doc__` (#104179)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-05-06 19:05:34 -07:00
Itamar Ostricher 4ee2068c34
gh-104254: Document the optional keyword-only "context" argument to Task constructor (#104251)
(This was added in 3.11. It was already documented for `create_task()`, but not for `Task()`.)
2023-05-06 18:31:53 -07:00