summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-103247: clear the module cache in a test in ↵sunmy20192023-05-101-9/+10
| | | | test_importlib/extensions/test_loader.py (GH-104226)
* gh-103848: Adds checks to ensure that bracketed hosts found by urlsplit are ↵JohnJamesUtley2023-05-102-1/+41
| | | | | | | | | 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>
* gh-74895: adjust tests to work on Solaris (#104326)Jakub Kulík2023-05-091-6/+6
| | | Solaris is unusual here, but apparently everyone is happy when SOCK_STREAM is explicitly specified.
* gh-104328: Fix typo in ``typing.Generic`` multiple inheritance error message ↵Kirill Podoprigora2023-05-091-1/+1
| | | | (#104335)
* gh-97933: (PEP 709) inline list/dict/set comprehensions (#101441)Carl Meyer2023-05-098-95/+263
| | | | Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-99889: Fix directory traversal security flaw in uu.decode() (#104096)Sam Carroll2023-05-092-1/+36
| | | | | | | | | * 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]
* gh-104139: Add itms-services to uses_netloc urllib.parse. (#104312)Gregory P. Smith2023-05-092-15/+20
| | | | 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.
* gh-104240: return code unit metadata from codegen (#104300)Irit Katriel2023-05-092-2/+2
|
* gh-103193: Fix refleaks in `test_inspect` and `test_typing` (#104320)Alex Waygood2023-05-091-0/+7
|
* gh-97696 Remove unnecessary check for eager_start kwarg (#104188)Jacob Bower2023-05-091-4/+17
| | | | Instead, add docstring to create_eager_task_factory.
* gh-104310: Add importlib.util.allowing_all_extensions() (gh-104311)Eric Snow2023-05-083-0/+160
| | | (I'll be adding docs for this separately.)
* gh-89550: Buffer GzipFile.write to reduce execution time by ~15% (#101251)Arjun2023-05-081-5/+35
| | | | | | | | 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>
* gh-104223: Fix issues with inheriting from buffer classes (#104227)Jelle Zijlstra2023-05-081-0/+170
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-103193: Improve `getattr_static` test coverage (#104286)Alex Waygood2023-05-081-0/+29
|
* gh-104273: Remove redundant len() calls in argparse function (#104274)Burak Saler2023-05-071-3/+4
|
* gh-104265 Disallow instantiation of `_csv.Reader` and `_csv.Writer` (#104266)chgnrdv2023-05-071-1/+8
|
* GH-102613: Improve performance of `pathlib.Path.rglob()` (GH-104244)Barney Gale2023-05-072-18/+42
| | | | | | | | | | 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.
* gh-103650: Fix perf maps address format (#103651)Arthur Pastel2023-05-071-3/+9
|
* GH-89812: Churn `pathlib.Path` methods (GH-104243)Barney Gale2023-05-071-303/+303
| | | | | | | | | | | | | | | 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.
* gh-104240: make _PyCompile_CodeGen support different compilation modes (#104241)Irit Katriel2023-05-071-0/+4
|
* gh-103193: cache calls to `inspect._shadowed_dict` in ↵Alex Waygood2023-05-072-2/+28
| | | | | `inspect.getattr_static` (#104267) Co-authored-by: Carl Meyer <carl@oddbird.net>
* GH-100479: Fix pathlib test failure on WASI (#104215)Barney Gale2023-05-071-1/+2
|
* gh-100370: fix OverflowError in sqlite3.Connection.blobopen for 32-bit ↵Erlend E. Aasland2023-05-071-0/+8
| | | | builds (#103902)
* Re-enable commented-out test in test_generators.py (#104130)ymki43602023-05-071-5/+4
|
* gh-101640: Make argparse _print_message catch any write error (#101802)Oleg Iarygin2023-05-062-3/+36
| | | | | | * In particular, don't exit when trying to print to stderr = None. * Add tests Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-99113: Add a check for Py_MOD_PER_INTERPRETER_GIL_SUPPORTED (gh-104206)Eric Snow2023-05-062-0/+22
| | | Py_MOD_PER_INTERPRETER_GIL_SUPPORTED is a new supported value for Py_mod_multiple_interpreters, added in gh-104205.
* GH-103548: Improve performance of `pathlib.Path.[is_]absolute()` (GH-103549)Barney Gale2023-05-061-1/+10
| | | | Improve performance of `pathlib.Path.absolute()` and `cwd()` by joining paths only when necessary. Also improve performance of `PurePath.is_absolute()` on Posix by skipping path parsing and normalization.
* gh-90953: Emit deprecation warnings for `ast` features deprecated in Python ↵Alex Waygood2023-05-062-135/+455
| | | | | | | 3.8 (#104199) `ast.Num`, `ast.Str`, `ast.Bytes`, `ast.Ellipsis` and `ast.NameConstant` now all emit deprecation warnings on import, access, instantation or `isinstance()` checks. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-104144: Optimize gather to finish eagerly when all futures complete ↵Itamar Ostricher2023-05-061-1/+12
| | | | eagerly (#104138)
* Rewrite the turtledemo makeGraphFrame method (#104224)Terry Jan Reedy2023-05-061-10/+14
| | | | | | | Replace `self._canvas` and `self.scanvas`, both bound to `canvas`, with `self.canvas, which is accessed in other methods. Replace `_s_` with `screen` and `_s_._canvas` with `canvas`. Add a comment explaining the unorthodox use of function turtle.Screen and singleton class turtle._Screen.
* gh-65772: Clean-up turtle module (#104218)Terry Jan Reedy2023-05-061-40/+21
| | | | | | | | | | | | | | | | | | | | | | | * Remove the unused, private, and undocumented name `_ver` and the commented-out `print` call. * Don't add math functions to `__all__`. Beginners should learn to `import math` to access them. * Gregor Lindel, who wrote this version of turtle, dropped plans to implement turtle on another toolkit at least a decade ago. Drop `_dot` code preparing for this, but add a hint comment. * `_Screen` is meant to be a singleton class. To enforce that, it needs either a `__new__` that returns the singleton or `else...raise` in `__iter__`. Merely removing the `if` clauses as suggested might break something if a user were to call `_Screen` directly. Leave the code alone until a problem is evident. * Turtledemo injects into _Screen both _root and _canvas, configured as it needs them to be. Making _canvas an `__init__` option would require skipping some but not all of the lines under 'if _Screen._canvas is None:`. Leave working code alone.
* gh-104144: Skip scheduling a done callback if a TaskGroup task completes ↵Itamar Ostricher2023-05-051-2/+8
| | | | | eagerly (#104140) Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-99113: Add PyInterpreterConfig.own_gil (gh-104204)Eric Snow2023-05-054-10/+29
| | | | | We also add PyInterpreterState.ceval.own_gil to record if the interpreter actually has its own GIL. Note that for now we don't actually respect own_gil; all interpreters still share the one GIL. However, PyInterpreterState.ceval.own_gil does reflect PyInterpreterConfig.own_gil. That lie is a temporary one that we will fix when the GIL really becomes per-interpreter.
* gh-104108: Add the Py_mod_multiple_interpreters Module Def Slot (gh-104148)Eric Snow2023-05-051-21/+61
| | | I'll be adding a value to indicate support for per-interpreter GIL in gh-99114.
* GH-100479: Add `pathlib.PurePath.with_segments()` (GH-103975)Barney Gale2023-05-052-45/+73
| | | | | Add `pathlib.PurePath.with_segments()`, which creates a path object from arguments. This method is called whenever a derivative path is created, such as from `pathlib.PurePath.parent`. Subclasses may override this method to share information between path objects. Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-69152: Add _proxy_response_headers attribute to HTTPConnection (#26152)Alexey Namyotkin2023-05-052-11/+21
| | | | | | | Add _proxy_response_headers attribute to HTTPConnection (#26152) --------- Co-authored-by: Senthil Kumaran <senthil@python.org>
* gh-103533: Use PEP 669 APIs for cprofile (GH-103534)Tian Gao2023-05-051-5/+14
|
* gh-64595: Argument Clinic: Touch source file if any output file changed ↵Erlend E. Aasland2023-05-051-3/+4
| | | | (#104152)
* gh-64631: Test exception messages in cloned Argument Clinic funcs (#104167)Erlend E. Aasland2023-05-051-0/+13
|
* gh-68395: Avoid naming conflicts by mangling variable names in Argument ↵Erlend E. Aasland2023-05-051-0/+169
| | | | | Clinic (#104065) Add all internally used variable names to CLINIC_PREFIXED_ARGS.
* GH-104142: Fix _Py_RefcntAdd to respect immortality (GH-104143)Brandt Bucher2023-05-041-18/+25
|
* gh-68968: Correcting message display issue with assertEqual (#103937)Michael Blahay2023-05-043-11/+86
|
* GH-103899: Provide a hint when accidentally calling a module (GH-103900)Brandt Bucher2023-05-041-0/+32
|
* GH-81079: Add case_sensitive argument to `pathlib.Path.glob()` (GH-102710)Barney Gale2023-05-042-15/+31
| | | | | | This argument allows case-sensitive matching to be enabled on Windows, and case-insensitive matching to be enabled on Posix. Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* gh-91896: Deprecate collections.abc.ByteString (#102096)Shantanu2023-05-042-6/+36
| | | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-99593: Add tests for Unicode C API (part 2) (#99868)Serhiy Storchaka2023-05-041-33/+464
| | | | | Add tests for lower-level functions. Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
* gh-102500: Implement PEP 688 (#102521)Jelle Zijlstra2023-05-045-3/+192
| | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-102795: Fix use of poll in test_epoll's test_control_and_wait (#102796)Kevin Krakauer2023-05-041-4/+11
| | | | | | | | | | This test can fail unnecessarily. In the test we wait for events on two file descriptors. This is done in a single call to select.epoll's poll() function. However, it is valid for the OS to return only one event via poll() and the next via a subsequent call to poll(). This rarely happens, but it can cause the test to fail despite properly functioning polling. Instead, we poll a second time when necessary.
* Fix typo "involvin" → "involving" (#104166)Christopher Chavez2023-05-042-2/+2
|
* gh-97556: Raise null bytes syntax error upon null in multiline string ↵Lysandros Nikolaou2023-05-041-0/+13
| | | | (GH-104136)