summaryrefslogtreecommitdiff
path: root/Lib
Commit message (Collapse)AuthorAgeFilesLines
* gh-103606: Improve error message from logging.config.FileConfig (GH-103628)HEADmainPrince Roshan2023-05-182-6/+52
|
* gh-104499: Fix typo. (#104598)Terry Jan Reedy2023-05-181-1/+1
|
* gh-104499: IDLE - fix completions for tk aqua 8.7 (#104591)Terry Jan Reedy2023-05-172-7/+5
|
* gh-104340: Suppress warning about unawaited exception for closed pipe stdin ↵Guido van Rossum2023-05-171-0/+3
| | | | (#104586)
* gh-104555: Runtime-checkable protocols: Don't let previous calls to ↵Alex Waygood2023-05-172-7/+89
| | | | | `isinstance()` influence whether `issubclass()` raises an exception (#104559) Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-104496: IDLE - fix About for mixed tcl/tk versions (#104585)Terry Jan Reedy2023-05-173-23/+21
| | | Print both if they are different, as may happen in the future.
* typing: Add more tests for TypeVar (#104571)Jelle Zijlstra2023-05-172-7/+49
| | | | | | | | During the PEP 695 implementation at one point I made TypeVar.__name__ return garbage, and all of test_typing passed. So I decided to add a few more tests. In the process I discovered a minor incompatibility from the C implementation of TypeVar: empty constraints were returned as None instead of an empty tuple.
* gh-104572: Improve error messages for invalid constructs in PEP 695 contexts ↵Jelle Zijlstra2023-05-171-0/+62
| | | | (#104573)
* typing: Use PEP 695 syntax in typing.py (#104553)Jelle Zijlstra2023-05-171-11/+17
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-102153: Start stripping C0 control and space chars in `urlsplit` (#102508)Illia Volochii2023-05-172-1/+72
| | | | | | | | | `urllib.parse.urlsplit` has already been respecting the WHATWG spec a bit #25595. This adds more sanitizing to respect the "Remove any leading C0 control or space from input" [rule](https://url.spec.whatwg.org/#url-parsing:~:text=Remove%20any%20leading%20and%20trailing%20C0%20control%20or%20space%20from%20input.) in response to [CVE-2023-24329](https://nvd.nist.gov/vuln/detail/CVE-2023-24329). --------- Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* gh-87474: Fix file descriptor leaks in subprocess.Popen (#96351)cptpcrd2023-05-161-130/+163
| | | | | | | This fixes several ways file descriptors could be leaked from `subprocess.Popen` constructor during error conditions by opening them later and using a context manager "fds to close" registration scheme to ensure they get closed before returning. --------- Co-authored-by: Gregory P. Smith [Google] <greg@krypto.org>
* gh-75367: Fix data descriptor detection in inspect.getattr_static (#104517)Furkan Onder2023-05-162-2/+7
| | | Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-104555: Fix isinstance() and issubclass() for runtime-checkable protocols ↵Alex Waygood2023-05-162-1/+19
| | | | | that use PEP 695 (#104556) Fixes #104555
* gh-103865: add monitoring support to LOAD_SUPER_ATTR (#103866)Carl Meyer2023-05-162-4/+222
|
* gh-103861: Fix Zip64 extensions not being properly applied in some cases ↵Carey Metcalfe2023-05-162-15/+170
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (#103863) Fix Zip64 extensions not being properly applied in some cases: Fixes an issue where adding a small file to a `ZipFile` object while forcing zip64 extensions causes an extra Zip64 record to be added to the zip, but doesn't update the `min_version` or file sizes in the primary central directory header. Also fixed an edge case in checking if zip64 extensions are required: This fixes an issue where if data requiring zip64 extensions was added to an unseekable stream without specifying `force_zip64=True`, zip64 extensions would not be used and a RuntimeError would not be raised when closing the file (even though the size would be known at that point). This would result in successfully writing corrupt zip files. Deciding if zip64 extensions are required outside of the `FileHeader` function means that both `FileHeader` and `_ZipWriteFile` will always be in sync. Previously, the `FileHeader` function could enable zip64 extensions without propagating that decision to the `_ZipWriteFile` class, which would then not correctly write the data descriptor record or check for errors on close. If anyone is actually using `ZipInfo.FileHeader` as a public API without explicitly passing True or False in for zip64, their own code may still be susceptible to that kind of bug unless they make a similar change to where the zip64 decision happens. Fixes #103861 --------- Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-69152: add method get_proxy_response_headers to HTTPConnection class ↵Alexey Namyotkin2023-05-162-9/+30
| | | | | | | | | | (#104248) Add http.client.HTTPConnection method get_proxy_response_headers() - this is a followup to https://github.com/python/cpython/pull/26152 which added it as a non-public attribute. This way we don't pre-compute a headers dictionary that most users will never access. The new method is properly public and documented and triggers full proxy header parsing into a dict only when actually called. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-103763: Implement PEP 695 (#103764)Jelle Zijlstra2023-05-1512-507/+1380
| | | | | | | | | | | | | | This implements PEP 695, Type Parameter Syntax. It adds support for: - Generic functions (def func[T](): ...) - Generic classes (class X[T](): ...) - Type aliases (type X = ...) - New scoping when the new syntax is used within a class body - Compiler and interpreter changes to support the new syntax and scoping rules Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com> Co-authored-by: Eric Traut <eric@traut.com> Co-authored-by: Larry Hastings <larry@hastings.org> Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-104461: Run tkinter test_configure_screen on X11 only (GH-104462)Christopher Chavez2023-05-151-0/+2
|
* gh-104482: Fix error handling bugs in ast.c (#104483)Irit Katriel2023-05-151-0/+6
|
* GH-102613: Fix recursion error from `pathlib.Path.glob()` (GH-104373)Barney Gale2023-05-152-20/+16
| | | | Use `Path.walk()` to implement the recursive wildcard `**`. This method uses an iterative (rather than recursive) walk - see GH-100282.
* gh-101819: Isolate `_io` (#101948)Erlend E. Aasland2023-05-151-2/+5
| | | | Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-104494: Update certain Tkinter pack/place tests for Tk 8.7 errors (#104495)Christopher Chavez2023-05-151-4/+6
| | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-98539: Make _SSLTransportProtocol.abort() safe to call when closed (#104474)Sam Bull2023-05-141-1/+2
|
* GH-71383: IDLE - Document testing subsets of modules (#104463)Terry Jan Reedy2023-05-133-20/+29
|
* gh-75710: IDLE - add docstrings and comments to editor module (#104446)Terry Jan Reedy2023-05-131-25/+102
| | | | | Commit extracted from PR #3669. Will edit more later. Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
* gh-91896: Revert some very noisy DeprecationWarnings for `ByteString` (#104424)Alex Waygood2023-05-135-73/+16
|
* gh-99836: IDLE - update news.txt for 3.12 (#104444)Terry Jan Reedy2023-05-131-2/+13
| | | | | * gh-99836: IDLE 3.12 news.txt * gh-99836: IDLE - update news.txt for 3.12
* gh-104404: fix crasher with nested comprehensions plus lambdas (#104442)Carl Meyer2023-05-121-0/+8
|
* GH-104405: Add missing PEP 523 checks (GH-104406)Brandt Bucher2023-05-121-18/+70
|
* gh-103333: Pickle the keyword attributes of AttributeError (#103352)Charles Machalow2023-05-121-27/+34
| | | | | | * Pickle the `name` and `args` attributes of AttributeError when present. Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-103204: `http.server` - Enforce that HTTP version numbers must consist ↵Ben Kallus2023-05-122-0/+25
| | | | | | | | | | only of digits (#103205) Reject HTTP requests with invalid http/x.y version numbers: x or y being non-digits or too-long. --------- Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-104415: Fix refleak tests for `typing.ByteString` deprecation (#104416)Nikita Sobolev2023-05-121-0/+9
|
* GH-86275: Implementation of hypothesis stubs for property-based tests, with ↵Paul Ganssle2023-05-127-1/+621
| | | | | | | | | | | | | zoneinfo tests (#22863) These are stubs to be used for adding hypothesis (https://hypothesis.readthedocs.io/en/latest/) tests to the standard library. When the tests are run in an environment where `hypothesis` and its various dependencies are not installed, the stubs will turn any tests with examples into simple parameterized tests and any tests without examples are skipped. It also adds hypothesis tests for the `zoneinfo` module, and a Github Actions workflow to run the hypothesis tests as a non-required CI job. The full hypothesis interface is not stubbed out — missing stubs can be added as necessary. Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
* GH-103082: Filter LINE events in VM, to simplify tool implementation. ↵Mark Shannon2023-05-124-6/+65
| | | | | | | | (GH-104387) When monitoring LINE events, instrument all instructions that can have a predecessor on a different line. Then check that the a new line has been hit in the instrumentation code. This brings the behavior closer to that of 3.11, simplifying implementation and porting of tools.
* gh-104389: Add 'unused' keyword to Argument Clinic C converters (#104390)Erlend E. Aasland2023-05-121-0/+38
| | | | | | | | | Use the unused keyword param in the converter to explicitly mark an argument as unused: /*[clinic input] SomeBaseClass.stubmethod flag: bool(unused=True) [clinic start generated code]*/
* gh-91896: Improve visibility of `ByteString` deprecation warnings (#104294)Alex Waygood2023-05-115-12/+85
|
* gh-104371: Fix calls to `__release_buffer__` while an exception is active ↵Jelle Zijlstra2023-05-121-0/+13
| | | | | (#104378) Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
* gh-104377: fix cell in comprehension that is free in outer scope (#104394)Carl Meyer2023-05-111-4/+55
|
* gh-104392: Remove _paramspec_tvars from typing (#104393)Jelle Zijlstra2023-05-111-13/+6
| | | | This does nothing.
* gh-104396: uuid.py to skip platform check for emscripten and wasi (gh-104397)Jeong, YunWon2023-05-121-1/+1
|
* gh-99108: Refresh HACL* from upstream (#104401)Jonathan Protzenko2023-05-111-0/+9
| | | Refresh HACL* from upstream and add a SHA3 test hashing over 4GiB of data.
* gh-104301: Allow leading whitespace in disambiguated pdb statements (#104342)James Gerity2023-05-113-9/+38
|
* gh-104057: Fix direct invocation of test_support (GH-104069)Kirill Podoprigora2023-05-111-1/+1
|
* gh-87729: improve hit rate of LOAD_SUPER_ATTR specialization (#104270)Carl Meyer2023-05-112-4/+3
|
* GH-92184: Convert os.altsep to '/' in filenames when creating ZipInfo ↵Carey Metcalfe2023-05-111-0/+2
| | | | | | | | | objects (#92185) This causes the zipfile module to also consider the character defined by `os.altsep` (if there is one) to be a path separator and convert it to a forward slash, as defined by the zip specification. A logical no-op on all known platforms today as os.altsep is currently only set to a meaningful value on Windows (where it is "/").
* gh-104357: fix inlined comprehensions that close over iteration var (#104368)Carl Meyer2023-05-101-0/+10
|
* GH-90208: Suppress OSError exceptions from `pathlib.Path.glob()` (GH-104141)Barney Gale2023-05-112-46/+25
| | | | | | | | | | | `pathlib.Path.glob()` now suppresses all OSError exceptions, except those raised from calling `is_dir()` on the top-level path. Previously, `glob()` suppressed ENOENT, ENOTDIR, EBADF and ELOOP errors and their Windows equivalents. PermissionError was also suppressed unless it occurred when calling `is_dir()` on the top-level path. However, the selector would abort prematurely if a PermissionError was raised, and so `glob()` could return incomplete results.
* gh-103000: Optimise `dataclasses.asdict` for the common case (#104364)Alex Waygood2023-05-101-5/+12
| | | Co-authored-by: David Ellis <ducksual@gmail.com>
* GH-87695: Fix OSError from `pathlib.Path.glob()` (GH-104292)Barney Gale2023-05-102-2/+11
| | | | Fix issue where `pathlib.Path.glob()` raised `OSError` when it encountered a symlink to an overly long path.
* gh-104263: Rely on Py_NAN and introduce Py_INFINITY (GH-104202)Sebastian Berg2023-05-104-6/+15
| | | | | | | | | | This PR removes `_Py_dg_stdnan` and `_Py_dg_infinity` in favour of using the standard `NAN` and `INFINITY` macros provided by C99. This change has the side-effect of fixing a bug on MIPS where the hard-coded value used by `_Py_dg_stdnan` gave a signalling NaN rather than a quiet NaN. --------- Co-authored-by: Mark Dickinson <dickinsm@gmail.com>