| Commit message (Collapse) | Author | Age |
|
|
| |
Items checked by this test are always `str` and `dict` instances.
|
|
|
|
|
|
|
|
|
|
| |
* Make sure that the current exception is always normalized.
* Remove redundant type and traceback fields for the current exception.
* Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException
* Add new API functions: PyException_GetArgs, PyException_SetArgs
|
| |
|
| |
|
|\ |
|
| |
| |
| |
| |
| | |
testBytesOpen requires an ASCII filename, but TESTFN usually isn't ASCII.
Automerge-Triggered-By: GH:zware
|
|/ |
|
|
|
|
|
| |
(#101127)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
replacing hashlib primitives (for the non-OpenSSL case) with verified implementations from HACL*. This is the first PR in the series, and focuses specifically on SHA2-256 and SHA2-224.
This PR imports Hacl_Streaming_SHA2 into the Python tree. This is the HACL* implementation of SHA2, which combines a core implementation of SHA2 along with a layer of buffer management that allows updating the digest with any number of bytes. This supersedes the previous implementation in the tree.
@franziskuskiefer was kind enough to benchmark the changes: in addition to being verified (thus providing significant safety and security improvements), this implementation also provides a sizeable performance boost!
```
---------------------------------------------------------------
Benchmark Time CPU Iterations
---------------------------------------------------------------
Sha2_256_Streaming 3163 ns 3160 ns 219353 // this PR
LibTomCrypt_Sha2_256 5057 ns 5056 ns 136234 // library used by Python currently
```
The changes in this PR are as follows:
- import the subset of HACL* that covers SHA2-256/224 into `Modules/_hacl`
- rewire sha256module.c to use the HACL* implementation
Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
|
|
|
|
|
|
|
| |
(gh-101625)
This test should have been in gh-101431.
https://github.com/python/cpython/issues/59956
|
|
|
|
| |
parent fields (#101563)
|
|
|
| |
This PR fixes the buildbot failures introduced by the merge of #5561, by restricting the relevant tests to something that should work on both 32-bit and 64-bit platforms. It also silences some compiler warnings introduced in that PR.
|
|
|
|
| |
(GH-101590)
|
| |
|
|
|
|
|
| |
That causes the test to fail when run using a high UID as that ancient format
cannot represent it. The current default (PAX) and the old default (GNU) both
support high UIDs.
|
|
|
| |
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The summary of this diff is that it:
* adds a `_ctypes_alloc_format_padding` function to append strings like `37x` to a format string to indicate 37 padding bytes
* removes the branches that amount to "give up on producing a valid format string if the struct is packed"
* combines the resulting adjacent `if (isStruct) {`s now that neither is `if (isStruct && !isPacked) {`
* invokes `_ctypes_alloc_format_padding` to add padding between structure fields, and after the last structure field. The computation used for the total size is unchanged from ctypes already used.
This patch does not affect any existing aligment computation; all it does is use subtraction to deduce the amount of paddnig introduced by the existing code.
---
Without this fix, it would never include padding bytes - an assumption that was only
valid in the case when `_pack_` was set - and this case was explicitly not implemented.
This should allow conversion from ctypes structs to numpy structs
Fixes https://github.com/numpy/numpy/issues/10528
|
|
|
| |
This reverts commit 0ef92d979311ba82d4c41b22ef38e12e1b08b13d.
|
|
|
|
|
|
|
|
|
|
| |
Update bundled pip version to 23.0
This is the current latest version of `pip`.
---------
Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
|
|
|
|
|
|
|
| |
Fix the behaviour of the `__sizeof__` method (and hence the results returned by `sys.getsizeof`) for subclasses of `int`. Previously, `int` subclasses gave identical results to the `int` base class, ignoring the presence of the instance dictionary.
<!-- gh-issue-number: gh-101266 -->
* Issue: gh-101266
<!-- /gh-issue-number -->
|
|
|
|
| |
Resolves gh-101539
Related to gh-31898
|
|
|
|
| |
implementation is not available (#101567)
|
|
|
|
|
| |
ZlibDecompressor (#101323)
* Ensure test_zlib.ZlibDecompressorTest actually runs, fix errors in ZlibDecompressor.
|
|
|
|
|
| |
This is step 1 in potentially dropping all the "channel"-related code. Channels have already been removed from PEP 554.
https://github.com/python/cpython/issues/101524
|
|
|
|
| |
This reverts the core of #100618 while leaving relevant documentation
improvements and minor refactorings in place.
|
|
|
| |
skip test when no _multiprocessing (wasm, etc)
|
|
|
|
|
|
|
|
| |
This starts the process. Users who don't specify their own start method
and use the default on platforms where it is 'fork' will see a
DeprecationWarning upon multiprocessing.Pool() construction or upon
multiprocessing.Process.start() or concurrent.futures.ProcessPool use.
See the related issue and documentation within this change for details.
|
|
|
| |
* Fix AIX build by avoiding `subprocess` during bootstrap.
|
|
|
|
| |
runtime is installed (GH-101468)
|
|
|
|
|
| |
(#101302)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
|
| |
`asyncio.StreamWriter.start_tls` (#101335)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
|
|
|
|
| |
are not in a loop (#101413)
|
| |
|
| |
|
|
|
|
| |
variant. GH-101383)
|
|
|
|
|
| |
`warnings.warn()` gains the ability to skip stack frames based on code
filename prefix rather than only a numeric `stacklevel=` via a new
`skip_file_prefixes=` keyword argument.
|
| |
|
|
|
|
| |
Co-authored-by: Eryk Sun <eryksun@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
|
| |
Created from a patch file attached to an issue, by Anatoly Techtonik.
|
| |
|
|
|
|
|
| |
Fixes a reference counting issue with `ctypes.Structure` when a `from_param()` method call is used and the structure size is larger than a C pointer `sizeof(void*)`.
This problem existed for a very long time, but became more apparent in 3.8+ by change likely due to garbage collection cleanup timing changes.
|
|
|
|
| |
timeout value (#100523)
|
| |
|
| |
|
|
|
| |
this way they match an existing uuidgen command line tool.
|
|
|
|
|
|
| |
(GH-101013)
* Store exception stack depth in YIELD_VALUE's oparg and use it avoid expensive gen.throw() in gen.close() where possible.
|
| |
|
|
|
|
| |
(#101031)
|
|
|
|
|
|
|
| |
When testing element truth values, emit a DeprecationWarning in all implementations.
This had emitted a FutureWarning in the rarely used python-only implementation since ~2.7 and has always been documented as a behavior not to rely on.
Matching an element in a tree search but having it test False can be unexpected. Raising the warning enables making the choice to finally raise an exception for this ambiguous behavior in the future.
|
|
|
|
| |
signs for random.random()'s documentation (#101119)
|