Heap types now always visit the type in tp_traverse. See added docs for details.
This reverts commit 0169d3003b.
Automerge-Triggered-By: @encukou
(cherry picked from commit 1cf15af9a6)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Skip new "racing" socket tests which fail randomly until someone fix
them, to ease analysis of buildbot failures (skip tests which are
known to be broken/unstable).
(cherry picked from commit 84ee7e1573)
Co-authored-by: Victor Stinner <vstinner@python.org>
hashlib.compare_digest uses OpenSSL's CRYPTO_memcmp() function
when OpenSSL is available.
Note: The _operator module is a builtin module. I don't want to add
libcrypto dependency to libpython. Therefore I duplicated the wrapper
function and added a copy to _hashopenssl.c..
(cherry picked from commit db5aed931f)
Co-authored-by: Christian Heimes <christian@python.org>
* Use a more universal explanation of string interpolation rather than specifically referencing sprintf(), which depends on the reader having a C background.
Co-authored-by: Kyle Stanley <aeros167@gmail.com>
(cherry picked from commit eaca2aa117)
Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
If ctypes fails to convert the result of a callback or if a ctypes
callback function raises an exception, sys.unraisablehook is now
called with an exception set. Previously, the error was logged into
stderr by PyErr_Print().
(cherry picked from commit 10228bad04)
Co-authored-by: Victor Stinner <vstinner@python.org>
```
D:\a\cpython\cpython\Modules\_zoneinfo.c(903,52): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(904,44): warning C4267: '=': conversion from 'size_t' to 'unsigned int', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
D:\a\cpython\cpython\Modules\_zoneinfo.c(1772,31): warning C4244: '=': conversion from 'ssize_t' to 'uint8_t', possible loss of data [D:\a\cpython\cpython\PCbuild\_zoneinfo.vcxproj]
```
(cherry picked from commit e4799b9594)
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.
The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)
Co-authored-by: Sean Gillespie <sean@swgillespie.me>
Reason: the link `ftp://invisible-island.net/ncurses//5.9/ncurses-5.9-20120616-patch.sh.bz2` is dead, which prevents `Mac/BuildScript/build-installer.py` from completing. Looks like the host of the FTP server was changed to `ftp.invisible-island.net`, thus this proposal.
Signed-off-by: oleg.hoefling <oleg.hoefling@gmail.com>
(cherry picked from commit 7da46b676a)
Co-authored-by: Oleg Höfling <hoefling@users.noreply.github.com>
* bpo-39301: State that floor division is used for right shift operations
* Remove "without overflow check"
(cherry picked from commit af7553ac95)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
When a `SyntaxError` in the expression part of a fstring is found,
the filename attribute of the `SyntaxError` is always `<fstring>`.
With this commit, it gets changed to always have the name of the file
the fstring resides in.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>.
(cherry picked from commit f7b1e46156)
The scripts in `Tools/peg_generator/scripts` mostly assume that
`ast.parse` and `compile` use the old parser, since this was the
state of things, while we were developing them. They need to be
updated to always use the correct parser. `_peg_parser` is being
extended to support both parsing and compiling with both parsers.
(cherry picked from commit 9645930b5b)
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
:mod:`hashlib` no longer falls back to builtin hash implementations when
OpenSSL provides a hash digest and the algorithm is blocked by security
policy.
Signed-off-by: Christian Heimes <christian@python.org>
(cherry picked from commit 4cc2f9348c)
Co-authored-by: Christian Heimes <christian@python.org>
This was the only failure running unittest.main(test.test_idle) after imports.
(cherry picked from commit 905b3cd05f)
Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
* Fix as_completed docs to correctly state the function return value.
* Also, improves the general wording of the as_completed documentation.
Co-Authored-By: Rémi Lapeyre <remi.lapeyre@henki.fr>
Co-Authored-By: Kyle Stanley <aeros167@gmail.com>
Co-Authored-By: Yury Selivanov <yury@edgedb.com>
(cherry picked from commit 13206b52d1)
Co-authored-by: Bar Harel <bzvi7919@gmail.com>
This is more informative and avoids the question of whether the period should go inside or outside the quotation marks.
See also GH-20007.
(cherry picked from commit 2e76820a50)
Co-authored-by: Mathieu Dupuy <mathieu.dupuy@doctolib.com>
This updates _PyErr_ChainStackItem() to use _PyErr_SetObject()
instead of _PyErr_ChainExceptions(). This prevents a hang in
certain circumstances because _PyErr_SetObject() performs checks
to prevent cycles in the exception context chain while
_PyErr_ChainExceptions() doesn't.
(cherry picked from commit 7c30d12bd5)
Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
@ericvsmith I guess it is correct to merge it into master and not 3.9 directly?
Automerge-Triggered-By: @ericvsmith
(cherry picked from commit 30d5a7364d)
Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>
Co-authored-by: Florian Dahlitz <f2dahlitz@freenet.de>