The length field of StgDictObject for Structure class contains now
the total number of items in ffi_type_pointer.elements (excluding
the trailing null).
The old behavior of using the number of elements in the parent class can
cause the array to be truncated when it is copied, especially when there
are multiple layers of subclassing.
(cherry picked from commit 5f3cc90a12)
Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
Explicitly open and close files instead of using FileType.
(cherry picked from commit bd754b93ca)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Fix the same issue of PR #112604 on PPC64LE platform
Refactor tests to make easier to add more platfroms if needed.
(cherry picked from commit 6644ca45cd)
Change-Id: I31730a3ebe558570ce1d7a3b26db8392f18d1770
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
- Only attempt to figure out whether protocol members are "method members" or not if the class is marked as a runtime protocol. This information is irrelevant for non-runtime protocols; we can safely skip the risky introspection for them.
- Only do the risky getattr() calls in one place (the runtime_checkable class decorator), rather than in three places (_ProtocolMeta.__init__, _ProtocolMeta.__instancecheck__ and _ProtocolMeta.__subclasscheck__). This reduces the number of locations in typing.py where the risky introspection could go wrong.
- For runtime protocols, if determining whether a protocol member is callable or not fails, give a better error message. I think it's reasonable for us to reject runtime protocols that have members which raise strange exceptions when you try to access them. PEP-544 clearly states that all protocol member must be callable for issubclass() calls against the protocol to be valid -- and if a member raises when we try to access it, there's no way for us to figure out whether it's a callable member or not!
(cherry-picked from commit ed6ea3ea79)
`functools.partial` docs: Use the more common spelling for "referenceable" (GH-113675)
(cherry picked from commit 4de468cce1)
Co-authored-by: Rodrigo Girão Serrão <5621605+rodrigogiraoserrao@users.noreply.github.com>
gh-113628: Fix test_site test with long stdlib paths (GH-113640)
(cherry picked from commit 5dc79e3d7f)
Co-authored-by: Itamar Oren <itamarost@gmail.com>
gh-113602: Bail out when the parser tries to override existing errors (GH-113607)
(cherry picked from commit 9ed36d533a)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
GH- gh-111700: Fix syntax highlighting for C code in the "What's New In Python 3.12" documentation (GH-113609)
Fix PEP 684 syntax highlighting in what's new Python 3.12
(cherry picked from commit 9ce6c01e38)
Co-authored-by: Parth Doshi <doshi.parth9@gmail.com>
gh-101578: [doc] mention that PyErr_GetRaisedException returns NULL when the error indicator is not set (GH-113369)
(cherry picked from commit 2849cbb53a)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
gh-89414: Document that SIGCLD is not available on macOS (GH-113580)
Document that SIGCLD is not available on macOS
(cherry picked from commit f48a1bcb29)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Doc/library/os.rst: `os.waitid` absent on MacOS (GH-104558)
* Doc/library/os.rst: `os.waitid` absent on MacOS
(cherry picked from commit db1c882239)
Co-authored-by: John Hawkinson <jhawk@alum.mit.edu>
Co-authored-by: AN Long <aisk@users.noreply.github.com>
gh-110459: Make sure --with-openssl-rpath works on macOS (GH-113441)
* gh-110459: Make sure --with-openssl-rpath works on macOS
On macOS the `-rpath` linker flag is spelled differently
than on on platforms.
(cherry picked from commit cc13eabc7c)
Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Previously some error messages complained about incompatible
combinations of directives that are not contained in the format string.
(cherry picked from commit 4b2c3e8e43)
Co-authored-by: Gordon P. Hemsley <me@gphemsley.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 48c49739f5)
Co-authored-by: Yilei Yang <yileiyang@google.com>
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* Fix a crash when pass UINT_MAX.
* Fix an integer overflow on 64-bit non-Windows platforms.
(cherry picked from commit 0daf555c6f)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
This is so that we can run python -m test.test_interpreters. As such it
backports that aspect of commit 86a77f4e1a,
where it is implemented by a package __main__.py.
An active loop is only used when the `timeout` parameter is used on
POSIX.
When no timeout is used, the code calls `os.waitpid` internally (which puts
the process on a sleep status). On Windows, the internal Windows API
call accepts a timeout parameter, so that is delegated to the OS.
(cherry picked from commit 81ab0e8a4a)
Co-authored-by: Luis Pedro Coelho <luis@luispedro.org>