Fix the threading.Thread class at fork: do nothing if the thread is
already stopped (ex: fork called at Python exit). Previously, an
error was logged in the child process.
(cherry picked from commit 5909a494cd)
Co-authored-by: Victor Stinner <vstinner@python.org>
The University of Washington stopped hosting the IMAP documents. Link to a rescued copy on GitHub.
(cherry picked from commit aa01011003)
Co-authored-by: Yash Shete <universeyash4@gmail.com>
(cherry picked from commit bbeb2d266d)
Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
Co-authored-by: Jürgen Gmach <juergen.gmach@googlemail.com>
Fix building pycore_bitutils.h internal header on old clang version
without __builtin_bswap16() (ex: Xcode 4.6.3 on Mac OS X 10.7).
Add a new private _Py__has_builtin() macro to check for availability
of a preprocessor builtin function.
Co-Authored-By: Joshua Root <jmr@macports.org>
Co-authored-by: Joshua Root <jmr@macports.org>
(cherry picked from commit b3b98082c5)
On Windows, fix a regression in signal handling which prevented to
interrupt a program using CTRL+C. The signal handler can be run in a
thread different than the Python thread, in which case the test
deciding if the thread can handle signals is wrong.
On Windows, _PyEval_SignalReceived() now always sets eval_breaker to
1 since it cannot test _Py_ThreadCanHandleSignals(), and
eval_frame_handle_pending() always calls
_Py_ThreadCanHandleSignals() to recompute eval_breaker.
(cherry picked from commit d96a7a8313)
Co-authored-by: Victor Stinner <vstinner@python.org>
GH- Improve asyncio.wait function
The original code creates the futures set two times.
We can create this set before, avoiding the second creation.
This new behaviour [breaks the aiokafka library](https://github.com/aio-libs/aiokafka/pull/672), because it gives an iterator to that function, so the second iteration become empty.
Automerge-Triggered-By: GH:1st1
(cherry picked from commit 7e5ef0a571)
Co-authored-by: Diogo Dutra <diogodutradamata@gmail.com>
The onerror is supposed to be called with failed function, but in this case lstat is wrongly used instead of open.
Not sure if this needs bug or not...
Automerge-Triggered-By: GH:hynek
(cherry picked from commit e59b2deffd)
Co-authored-by: Michal Čihař <michal@cihar.com>
The overflow occurs under some circumstances when a task or future
recursively returns itself.
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit 42d873c63a)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
It is not clear why this can happen, but several users have mentioned
getting this exception on macOS.
(cherry picked from commit 23831a7a90)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Fixes a grammar problem by adding a missing "as", and clarifies the wording of the valid ranges for max_workers.
(cherry picked from commit fd6f6fa403)
Co-authored-by: Don Kirkby <donkirkby@users.noreply.github.com>
Otherwise, when running the testsuite, test_peg_generator tries to compile C
code using the optimized flags and fails because it cannot find the profile
data.
(cherry picked from commit 100964e031)
Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
* Prevent some possible DoS attacks via providing invalid Plist files
with extremely large number of objects or collection sizes.
* Raise InvalidFileException for too large bytes and string size instead of returning garbage.
* Raise InvalidFileException instead of ValueError for specific invalid datetime (NaN).
* Raise InvalidFileException instead of TypeError for non-hashable dict keys.
* Add more tests for invalid Plist files.
(cherry picked from commit 34637a0ce2)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
They were occurring with both repeated 'force-calltip' invocations and by typing parentheses
in expressions, strings, and comments in the argument code.
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit da7bb7b4d7)
Co-authored-by: Tal Einat <taleinat+github@gmail.com>
[[bpo-29566]()]() notes that binhex.binhex uses inconsistent line endings (both Unix and MacOS9 line endings are used). This PR changes this to use the MacOS9 line endings everywhere.
(cherry picked from commit 2165cea548)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Automerge-Triggered-By: GH:ronaldoussoren
Left-recursive rules need to check for errors explicitly, since
even if the rule returns NULL, the parsing might continue and lead
to long-distance failures.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
(cherry picked from commit 02cdfc93f8)
Automerge-Triggered-By: GH:lysnikolaou
Sort also dependencies and remove duplicates (liblzma-dev).
(cherry picked from commit 6e03c0ad15)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Victor Stinner <vstinner@python.org>
Follow up to 7cdf30fff3 and 4173320920. This addresses the point "1. Update links in typing, subscription and union to point to GenericAlias." in the bpo for this PR.
(cherry picked from commit 9129af6050)
Co-authored-by: kj <28750310+Fidget-Spinner@users.noreply.github.com>
func_dealloc() does not handle partially-created objects. Best not to give it any.
(cherry picked from commit 350526105f)
Co-authored-by: Yonatan Goldschmidt <yon.goldschmidt@gmail.com>
* Implement running the parser a second time for the errors messages
The first parser run is only responsible for detecting whether
there is a `SyntaxError` or not. If there isn't the AST gets returned.
Otherwise, the parser is run a second time with all the `invalid_*`
rules enabled so that all the customized error messages get produced.
(cherry picked from commit bca7014032)