summaryrefslogtreecommitdiffstats
path: root/Misc
Commit message (Collapse)AuthorAgeFilesLines
* GH-120754: Disable buffering in Path.read_bytes (#122111)Cody Maloney2024-08-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `Path.read_bytes()` is used to read a whole file. buffering / BufferedIO is focused around making small, possibly interleaved, read/write efficient which doesn't add value in this case. On my Mac, running the benchmark: ```python import pyperf from pathlib import Path def read_all(all_paths): for p in all_paths: p.read_bytes() def read_file(path_obj): path_obj.read_bytes() all_rst = list(Path("Doc").glob("**/*.rst")) all_py = list(Path(".").glob("**/*.py")) assert all_rst, "Should have found rst files" assert all_py, "Should have found python source files" runner = pyperf.Runner() runner.bench_func("read_file_small", read_file, Path("Doc/howto/clinic.rst")) runner.bench_func("read_file_large", read_file, Path("Doc/c-api/typeobj.rst")) ``` before: ```python ..................... read_file_small: Mean +- std dev: 6.80 us +- 0.07 us ..................... read_file_large: Mean +- std dev: 10.8 us +- 0.2 us ```` after: ```python ..................... read_file_small: Mean +- std dev: 5.67 us +- 0.05 us ..................... read_file_large: Mean +- std dev: 9.77 us +- 0.52 us ```
* gh-118658: Return consistent types from `get_un/verified_chain` in ↵Mateusz Nowak2024-08-161-0/+5
| | | | | `SSLObject` and `SSLSocket` (#118669) Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* GH-118093: Specialize `CALL_KW` (GH-123006)Mark Shannon2024-08-161-0/+5
|
* GH-121634: have `wasi.py` accept the host target triple as an argument ↵Brett Cannon2024-08-151-0/+1
| | | | (GH-123030)
* gh-113190: Reenable non-debug interned string cleanup (GH-113601)Eddie Elizondo2024-08-151-0/+1
|
* gh-112301: Add warning count to warning check tooling (#122711)Nate Ohlson2024-08-141-0/+2
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-99108: Add HACL* Blake2 implementation to hashlib (GH-119316)Jonathan Protzenko2024-08-132-210/+236
| | | | | | | This replaces the existing hashlib Blake2 module with a single implementation that uses HACL\*'s Blake2b/Blake2s implementations. We added support for all the modes exposed by the Python API, including tree hashing, leaf nodes, and so on. We ported and merged all of these changes upstream in HACL\*, added test vectors based on Python's existing implementation, and exposed everything needed for hashlib. This was joint work done with @R1kM. See the PR for much discussion and benchmarking details. TL;DR: On many systems, 8-50% faster (!) than `libb2`, on some systems it appeared 10-20% slower than `libb2`.
* gh-122907: Fix Builds Without HAVE_DYNAMIC_LOADING Set (gh-122952)Eric Snow2024-08-131-0/+3
| | | As of 529a160 (gh-118204), building with HAVE_DYNAMIC_LOADING stopped working. This is a minimal fix just to get builds working again. There are actually a number of long-standing deficiencies with HAVE_DYNAMIC_LOADING builds that need to be resolved separately.
* gh-122873: Allow "python -m json" to work (#122884)Trey Hunner2024-08-131-0/+3
| | | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com> Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
* GH-122821: Simplify compilation of while statements to ensure consistency of ↵Mark Shannon2024-08-131-0/+3
| | | | offsets for sys.monitoring (GH-122934)
* GH-122578: update to WASI SDK 24 (GH-122960)Brett Cannon2024-08-121-0/+1
|
* GH-118093: Handle some polymorphism before requiring progress in tier two ↵Brandt Bucher2024-08-121-0/+1
| | | | (GH-122843)
* gh-122888: Fix crash on certain calls to str() (#122889)Jelle Zijlstra2024-08-121-0/+2
| | | | Fixes #122888
* gh-122903: Honor directories in zipfile.Path.glob. (#122908)Jason R. Coombs2024-08-121-0/+2
|
* gh-122905: Sanitize names in zipfile.Path. (#122906)Jason R. Coombs2024-08-111-0/+1
| | | Ported from zipp 3.19.1; ref jaraco/zipp#119.
* GH-73991: Rework `pathlib.Path.copytree()` into `copy()` (#122369)Barney Gale2024-08-112-3/+1
| | | | | | | | | | Rename `pathlib.Path.copy()` to `_copy_file()` (i.e. make it private.) Rename `pathlib.Path.copytree()` to `copy()`, and add support for copying non-directories. This simplifies the interface for users, and nicely complements the upcoming `move()` and `delete()` methods (which will also accept any type of file.) Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-122858: Deprecate `asyncio.iscoroutinefunction` (#122875)Wulian2024-08-111-0/+2
| | | | | Deprecate `asyncio.iscoroutinefunction` in favor of `inspect.iscoroutinefunction`. Co-authored-by: Kumar Aditya <kumaraditya@python.org>
* gh-115808: Add ``is_none`` and ``is_not_none`` to ``operator`` (#115814)Nico Mexis2024-08-101-0/+1
| | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-105376: Restore deprecated logging warn() method (#122775)Victor Stinner2024-08-091-0/+3
| | | | | | | | | This reverts commit dcc028d92428bd57358a5028ada2a53fc79fc365 and commit 6c54e5d72166d012b52155cbf13af9e533290e06. Keep the deprecated logging warn() method in Python 3.13. Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-121268: Remove workarounds for non-IEEE 754 systems in cmath (#122716)Sergey B Kirpichev2024-08-091-0/+1
| | | | As now building Python now requires support of IEEE 754 floating point numbers.
* gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (#122764)Malcolm Smith2024-08-083-2/+4
| | | (LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
* GH-118943: Remove regen-jit from the regen-all make target (GH-122602)Miro Hrončok2024-08-081-0/+1
| | | Co-authored-by: Éric <merwok@netwok.org>
* gh-122697: Fix free-threading memory leaks at shutdown (#122703)Sam Gross2024-08-081-0/+2
| | | | | | | | | | | | | | | We were not properly accounting for interpreter memory leaks at shutdown and had two sources of leaks: * Objects that use deferred reference counting and were reachable via static types outlive the final GC. We now disable deferred reference counting on all objects if we are calling the GC due to interpreter shutdown. * `_PyMem_FreeDelayed` did not properly check for interpreter shutdown so we had some memory blocks that were enqueued to be freed, but never actually freed. * `_PyType_FinalizeIdPool` wasn't called at interpreter shutdown.
* gh-116263: Do not rollover empty files in RotatingFileHandler (GH-122788)Serhiy Storchaka2024-08-081-0/+2
|
* gh-105201: Add PyIter_NextItem() (#122331)Erlend E. Aasland2024-08-072-0/+4
| | | | | | | | | Return -1 and set an exception on error; return 0 if the iterator is exhausted, and return 1 if the next item was fetched successfully. Prefer this API to PyIter_Next(), which requires the caller to use PyErr_Occurred() to differentiate between iterator exhaustion and errors. Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
* gh-118814: Fix the TypeVar constructor when name is passed by keyword ↵Serhiy Storchaka2024-08-071-0/+1
| | | | | | | | (GH-122664) Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for positional-or-keyword parameter is passed by keyword. There was only one such case in the stdlib -- the TypeVar constructor.
* gh-122478: Remove internal frames from tracebacks in REPL (GH-122528)Serhiy Storchaka2024-08-071-0/+3
| | | | | | | | Frames of methods in code and codeop modules was show with non-default sys.excepthook. Save correct tracebacks in sys.last_traceback and update __traceback__ attribute of sys.last_value and sys.last_exc.
* gh-118761: Improve import time of `pprint` (#122725)Hugo van Kemenade2024-08-071-0/+2
| | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-100256: Skip inaccessible registry keys in the WinAPI mimetype ↵Lucas Esposito2024-08-072-0/+2
| | | | implementation (GH-122047)
* gh-121151: argparse: Fix wrapping of long usage text of arguments inside a ↵Ali Hamdan2024-08-071-0/+2
| | | | mutually exclusive groups (GH-121159)
* gh-79846: Make ssl.create_default_context() ignore invalid certificates ↵pukkandan2024-08-071-0/+2
| | | | | | | (GH-91740) An error in one certificate should not cause the whole thing to fail. Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* GH-73991: Rework `pathlib.Path.rmtree()` into `delete()` (#122368)Barney Gale2024-08-071-1/+1
| | | | | | Rename `pathlib.Path.rmtree()` to `delete()`, and add support for deleting non-directories. This simplifies the interface for users, and nicely complements the upcoming `move()` and `copy()` methods (which will also accept any type of file.)
* gh-122728: Fix SystemError in PyEval_GetLocals() (#122735)Victor Stinner2024-08-061-0/+2
| | | | | | | Fix PyEval_GetLocals() to avoid SystemError ("bad argument to internal function"). Don't redefine the 'ret' variable in the if block. Add an unit test on PyEval_GetLocals().
* gh-122744: Bump bundled pip to 24.2 (#122745)Pradyun Gedam2024-08-061-0/+1
| | | Co-authored-by: Pradyun Gedam <pradyunsg@users.noreply.github.com>
* gh-122417: Implement per-thread heap type refcounts (#122418)Sam Gross2024-08-061-0/+4
| | | | | | | The free-threaded build partially stores heap type reference counts in distributed manner in per-thread arrays. This avoids reference count contention when creating or destroying instances. Co-authored-by: Ken Jin <kenjin@python.org>
* gh-112301: Add macOS warning tracking tooling (#122211)Nate Ohlson2024-08-061-0/+2
| | | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-120104: IDLE: Fix padding in config and search dialogs (#120107)Serhiy Storchaka2024-08-061-0/+1
|
* gh-116622: Android logging fixes (#122698)Malcolm Smith2024-08-061-0/+1
| | | | Modifies the handling of stdout/stderr redirection on Android to accomodate the rate and buffer size limits imposed by Android's logging infrastructure.
* GH-118943: Handle races when moving jit_stencils.h (GH-120690)Miro Hrončok2024-08-051-0/+3
| | | Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
* gh-122459: Optimize pickling by name objects without __module__ (GH-122460)Serhiy Storchaka2024-08-051-0/+2
|
* gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574)Jonathan Protzenko2024-08-041-0/+1
| | | | | | Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+). Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com> Co-authored-by: Gregory P. Smith <greg@krypto.org>
* gh-122637: fix tanh(±0+infj) and tanh(±0+nanj) to return ±0+nanj (#122638)Sergey B Kirpichev2024-08-041-0/+1
| | | | | | | | | As per C11 DR#471, ctanh (0 + i NaN) and ctanh (0 + i Inf) should return 0 + i NaN (with "invalid" exception in the second case). This has corresponding implications for ctan(z), as its errors and special cases are handled as if the operation is implemented by -i*ctanh(i*z). This patch fixes cmath's code to do same. Glibs patch: https://sourceware.org/git/?p=glibc.git;a=commitdiff;h=d15e83c5f5231d971472b5ffc9219d54056ca0f1
* gh-121889: cmath.acosh(0+nanj) returns nan+pi/2j (#121892)Sergey B Kirpichev2024-08-041-0/+1
| | | | | As per C11 DR#471 (adjusted resolution accepted for C17), cacosh (0 + iNaN) should return NaN ± i pi/2, not NaN + iNaN. This patch fixes cmath's code to do same.
* gh-122527: Fix a crash on deallocation of `PyStructSequence` (GH-122577)Sam Gross2024-08-021-0/+4
| | | | | | | | | | | | | | The `PyStructSequence` destructor would crash if it was deallocated after its type's dictionary was cleared by the GC, because it couldn't compute the "real size" of the instance. This could occur with relatively straightforward code in the free-threaded build or with a reference cycle involving the type in the default build, due to differing orders in which `tp_clear()` was called. Account for the non-sequence fields in `tp_basicsize` and use that, along with `Py_SIZE()`, to compute the "real" size of a `PyStructSequence` in the dealloc function. This avoids the accesses to the type's dictionary during dealloc, which were unsafe.
* gh-122445: populate only modified fields in __static_attributes__ (#122446)Irit Katriel2024-08-021-0/+1
|
* gh-122334: Fix crash when importing ssl after re-initialization (#122481)neonene2024-08-021-0/+1
| | | | * Fix crash when importing ssl after re-initialization
* gh-121723: Relax constraints on queue objects for ↵Bénédikt Tran2024-08-021-0/+3
| | | | `logging.handlers.QueueHandler`. (GH-122154)
* gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (#120605)John Riggles2024-08-021-0/+1
| | | | | | | | On recent versions of macOS (sometime between Catalina and Sonoma 14.5), the default Hovertip foreground color changed from black to white, thereby matching the background. This might be a matter of matching the white foreground of the dark-mode text. The unreadable result is shown here (#120083 (comment)). The foreground and background colors were made parameters so we can pass different colors for future additional hovertips in IDLE. --------- Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* gh-116622: Don't expose `FICLONE` ioctl on Android (#122522)Malcolm Smith2024-08-011-0/+2
| | | | | Don't expose `FICLONE` ioctl on Android Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
* gh-87320: In the code module, handle exceptions raised in sys.excepthook ↵CF Bolz-Tereick2024-07-311-0/+3
| | | | | | | (GH-122456) Before, the exception caused by calling non-default sys.excepthook in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.