On Windows, fix asyncio recv_into() return value when the socket/pipe
is closed (BrokenPipeError): return 0 rather than an empty byte
string (b'').
(cherry picked from commit 602a971a2a)
Co-authored-by: Victor Stinner <vstinner@python.org>
This consolidates the handling of my_fgets return values, so that interrupts are always handled, even if they come after EOF.
I believe PyOS_StdioReadline is still buggy in that I/O errors will not result in a proper Python exception being set. However, that is a separate issue.
(cherry picked from commit a74eea238f)
Co-authored-by: Benjamin Peterson <benjamin@python.org>
... when an unknown option is passed. TypeError was being raised because a 2to3 fix was missing.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit f1d40f941a)
Co-authored-by: Akuli <akuviljanen17@gmail.com>
PEP 563 was updated to change the release where `from __future__ import annotations` becomes the default (and only) behavior from 4.0 to 3.10. Update `__future__.py` and its docs to reflect this.
(cherry picked from commit 0028c14073)
Co-authored-by: YoSTEALTH <35307184+YoSTEALTH@users.noreply.github.com>
Fixes regression in 3.8.4 and 3.9.0b4.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 0dd463c8a4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Just a simple documentation fix: apply_async and map_async return a "multiprocessing.pool.AsyncResult Object", not a "result object".
(cherry picked from commit f9bf015799)
Co-authored-by: Volker-Weissmann <39418860+Volker-Weissmann@users.noreply.github.com>
These changes updates the doc to comprehensively mention the behaviour of gather.cancel()
Automerge-Triggered-By: @asvetlov
(cherry picked from commit d42528a3a2)
Co-authored-by: Vinay Sharma <vinay04sharma@icloud.com>
GH-msg373510
[bpo-32528]()/GH-13528 changed `asyncio.CancelledError` such that it no longer inherits from `concurrent.futures.CancelledError`. As this affects existing code, specifically when catching the latter instead of the former in exception handling, it should be documented in the "What's new in 3.8?" document.
Automerge-Triggered-By: @1st1
(cherry picked from commit 2a5181829a)
Co-authored-by: JustAnotherArchivist <JustAnotherArchivist@users.noreply.github.com>
Walk down the MRO backwards to find the type that originally defined the final `tp_setattro`, then make sure we are not jumping over intermediate C-level bases with the Python-level call.
Automerge-Triggered-By: @gvanrossum
(cherry picked from commit c53b310e59)
Co-authored-by: scoder <stefan_ml@behnel.de>
reject control chars in http method in http.client.putrequest to prevent http header injection
(cherry picked from commit 8ca8a2e8fb)
Co-authored-by: AMIR <31338382+amiremohamadi@users.noreply.github.com>
This should also fix the syntax highlighting for these code blocks
Automerge-Triggered-By: @csabella
(cherry picked from commit 5e5c0f9866)
Co-authored-by: Christopher Yeh <chrisyeh96@users.noreply.github.com>
Define UNUSED only when mpdecimal.h doesn't define it. This would support
building with system libmpdec 2.5 while retaining compatibility with system
libmpdec 2.4 or the vendored copy.
Tested to build fine with either system libmpdec or the vendored one.
Avoid infinite loop when reading specially crafted TAR files using the tarfile module
(CVE-2019-20907).
(cherry picked from commit 5a8d121a1f)
Co-authored-by: Rishi <rishi_devan@mail.com>
Automerge-Triggered-By: @encukou
The phrase "At any time during execution," was repeated twice.
Automerge-Triggered-By: @Mariatta
(cherry picked from commit 4f28f75dee)
Co-authored-by: Paul McMillan <paul@mcmillan.ws>
The issue is triggered by the bytearray() + bytearray() operation.
Detected by GCC 10 static analysis tool.
(cherry picked from commit 61fc23ca10)
Co-authored-by: stratakis <cstratak@redhat.com>
Keywords are present in the main module tab completion lists generated by rlcompleter, which is used by REPLs on *nix. Add all keywords to IDLE's main module name list except those already added from builtins (True, False, and None) . This list may also be used by Show Completions on the Edit menu, and its hot key.
Rewrite Completions doc.
Co-authored-by: Cheryl Sabella <cheryl.sabella@gmail.com>
(cherry picked from commit bce2eb4646)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
The running loop holder cache variable was always set to NULL when
calling set_running_loop.
Now set_running_loop saves the newly created running loop holder in the
cache variable for faster access in get_running_loop.