summaryrefslogtreecommitdiffstats
path: root/Misc/NEWS.d
Commit message (Collapse)AuthorAgeFilesLines
* fixes gh-109559: Update `unicodedata` for Unicode 15.1.0 (GH-109560)James Gerity2023-09-201-0/+1
| | | | | --------- Co-authored-by: Benjamin Peterson <benjamin@python.org>
* gh-109543: Remove unnecessary hasattr check (#109544)Jelle Zijlstra2023-09-201-0/+2
| | | | Also added a new test case covering the scenario I thought this might be about.
* gh-103053: Skip test_freeze_simple_script() on PGO build (#109591)Victor Stinner2023-09-201-0/+4
| | | | | | | | | | Skip test_freeze_simple_script() of test_tools.test_freeze if Python is built with "./configure --enable-optimizations", which means with Profile Guided Optimization (PGO): it just makes the test too slow. The freeze tool is tested by many other CIs with other (faster) compiler flags. test.pythoninfo now gets also get_build_info() of test.libregrtests.utils.
* gh-109109: Expose retrieving certificate chains in SSL module (#109113)Mateusz Nowak2023-09-201-0/+5
| | | | | Adds APIs to get the TLS certificate chains, verified or full unverified, from SSLSocket and SSLObject. Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* gh-109033: Return filename with os.utime errors (#109034)Ronan Pigott2023-09-191-0/+2
| | | | | | | The filename was previously intentionally omitted from exception because "it might confuse the user". Uncaught exceptions are not generally a replacement for user-facing error messages, so obscuring this information only has the effect of making the programmer's life more difficult.
* gh-109580: Skip test_perf_profiler on ASAN build (#109584)Victor Stinner2023-09-191-0/+3
| | | | Skip test_perf_profiler if Python is built with ASAN, MSAN or UBSAN sanitizer. Python does crash randomly in this test on such build.
* gh-108724: Add PyMutex and _PyParkingLot APIs (gh-109344)Sam Gross2023-09-191-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | PyMutex is a one byte lock with fast, inlineable lock and unlock functions for the common uncontended case. The design is based on WebKit's WTF::Lock. PyMutex is built using the _PyParkingLot APIs, which provides a cross-platform futex-like API (based on WebKit's WTF::ParkingLot). This internal API will be used for building other synchronization primitives used to implement PEP 703, such as one-time initialization and events. This also includes tests and a mini benchmark in Tools/lockbench/lockbench.py to compare with the existing PyThread_type_lock. Uncontended acquisition + release: * Linux (x86-64): PyMutex: 11 ns, PyThread_type_lock: 44 ns * macOS (arm64): PyMutex: 13 ns, PyThread_type_lock: 18 ns * Windows (x86-64): PyMutex: 13 ns, PyThread_type_lock: 38 ns PR Overview: The primary purpose of this PR is to implement PyMutex, but there are a number of support pieces (described below). * PyMutex: A 1-byte lock that doesn't require memory allocation to initialize and is generally faster than the existing PyThread_type_lock. The API is internal only for now. * _PyParking_Lot: A futex-like API based on the API of the same name in WebKit. Used to implement PyMutex. * _PyRawMutex: A word sized lock used to implement _PyParking_Lot. * PyEvent: A one time event. This was used a bunch in the "nogil" fork and is useful for testing the PyMutex implementation, so I've included it as part of the PR. * pycore_llist.h: Defines common operations on doubly-linked list. Not strictly necessary (could do the list operations manually), but they come up frequently in the "nogil" fork. ( Similar to https://man.freebsd.org/cgi/man.cgi?queue) --------- Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
* gh-102757: fix function signature mismatch for `functools.reduce` between ↵Xuehai Pan2023-09-181-0/+2
| | | | code and documentation (#102759)
* gh-109496: Detect Py_DECREF() after dealloc in debug mode (#109539)Victor Stinner2023-09-181-0/+5
| | | | | | | | | On a Python built in debug mode, Py_DECREF() now calls _Py_NegativeRefcount() if the object is a dangling pointer to deallocated memory: memory filled with 0xDD "dead byte" by the debug hook on memory allocators. The fix is to check the reference count *before* checking for _Py_IsImmortal(). Add test_decref_freed_object() to test_capi.test_misc.
* gh-109371: Fix monitoring with instruction events set (gh-109385)Tian Gao2023-09-181-0/+1
|
* gh-108843: fix ast.unparse for f-string with many quotes (#108981)Shantanu2023-09-181-0/+1
|
* gh-108511: Add C API functions which do not silently ignore errors (GH-109025)Serhiy Storchaka2023-09-171-0/+4
| | | | | | | | | Add the following functions: * PyObject_HasAttrWithError() * PyObject_HasAttrStringWithError() * PyMapping_HasKeyWithError() * PyMapping_HasKeyStringWithError()
* GH-83417: Allow `venv` to add a `.gitignore` file to environments via a new ↵Brett Cannon2023-09-151-0/+3
| | | | | | | | `scm_ignore_file` parameter (GH-108125) This feature is off by default via code but on by default via the CLI. The `.gitignore` file contains `*` which causes the entire directory to be ignored. Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com> Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* gh-106213: Make Emscripten trampolines work with JSPI (GH-106219)Hood Chatham2023-09-151-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | There is a WIP proposal to enable webassembly stack switching which have been implemented in v8: https://github.com/WebAssembly/js-promise-integration It is not possible to switch stacks that contain JS frames so the Emscripten JS trampolines that allow calling functions with the wrong number of arguments don't work in this case. However, the js-promise-integration proposal requires the [type reflection for Wasm/JS API](https://github.com/WebAssembly/js-types) proposal, which allows us to actually count the number of arguments a function expects. For better compatibility with stack switching, this PR checks if type reflection is available, and if so we use a switch block to decide the appropriate signature. If type reflection is unavailable, we should use the current EMJS trampoline. We cache the function argument counts since when I didn't cache them performance was negatively affected. Co-authored-by: T. Wouters <thomas@python.org> Co-authored-by: Brett Cannon <brett@python.org>
* gh-109096: Deprecate `http.server.CGIHTTPRequestHandler` (#109387)Gregory P. Smith2023-09-151-0/+3
| | | | | Deprecate `http.server.CGIHTTPRequestHandler`. Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-109425: regrtest decodes worker stdout with backslashreplace (#109428)Victor Stinner2023-09-141-0/+3
| | | | | libregrtest now decodes stdout of test worker processes with the "backslashreplace" error handler to log corrupted stdout, instead of failing with an error and not logging the stdout.
* gh-109375: Fix bug where pdb registers an alias without an associated ↵buermarc2023-09-141-0/+1
| | | | command (#109376)
* gh-109396: Fix test_socket.test_hmac_sha1() in FIPS mode (#109423)Victor Stinner2023-09-141-0/+3
| | | | Use a longer key: FIPS mode requires at least of at least 112 bits. The previous key was only 32 bits.
* gh-109219: propagate free vars through type param scopes (#109377)Carl Meyer2023-09-141-0/+2
| | | Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-105658: fix excess trace events for except block ending with a ↵Irit Katriel2023-09-141-0/+2
| | | | conditional block (#109384)
* GH-105848: Replace KW_NAMES + CALL with LOAD_CONST + CALL_KW (GH-109300)Brandt Bucher2023-09-131-0/+3
|
* gh-109341: Fix crash on compiling invalid AST including TypeAlias (#109349)Jelle Zijlstra2023-09-131-0/+1
|
* gh-109351: Fix crash when compiling AST with invalid NamedExpr (#109352)Jelle Zijlstra2023-09-131-0/+2
|
* gh-109156: Add tests for de-instrumenting instructions with instrumented ↵Tian Gao2023-09-131-0/+1
| | | | lines (GH-109157)
* gh-104736: Fix test_gdb tests on ppc64le with clang (#109360)Victor Stinner2023-09-131-0/+4
| | | | | | Fix test_gdb on Python built with LLVM clang 16 on Linux ppc64le (ex: Fedora 38). Search patterns in gdb "bt" command output to detect when gdb fails to retrieve the traceback. For example, skip a test if "Backtrace stopped: frame did not save the PC" is found.
* gh-109319: deprecate dis.HAVE_ARGUMENT (#109320)Irit Katriel2023-09-121-0/+1
|
* gh-84867: Do not load tests from TestCase and FunctionTestCase (GH-100497)Nikita Sobolev2023-09-121-0/+2
|
* gh-109256: allocate opcode IDs for internal opcodes in their own range (#109269)Irit Katriel2023-09-121-0/+2
|
* gh-109216: Fix possible memory leak in `BUILD_MAP` (#109257)Nikita Sobolev2023-09-121-0/+1
|
* gh-109276: libregrtest calls random.seed() before each test (#109279)Victor Stinner2023-09-121-0/+6
| | | | | | | | | | | | | libregrtest now calls random.seed() before running each test file when -r/--randomize command line option is used. Moreover, it's also called in worker processes. It should help to make tests more deterministic. Previously, it was only called once in the main process before running all test files and it was not called in worker processes. * Convert some f-strings to regular strings in test_regrtest when f-string is not needed. * Remove unused all_methods variable from test_regrtest. * Add RunTests members are now mandatory.
* GH-106734: Disable tab completion in pdb's multiline mode (GH-106735)Tian Gao2023-09-121-0/+1
|
* gh-109118: Disallow nested scopes within PEP 695 scopes within classes (#109196)Jelle Zijlstra2023-09-121-0/+2
| | | | | Fixes #109118. Fixes #109194. Co-authored-by: Carl Meyer <carl@oddbird.net>
* gh-109195: fix source location for super load before LOAD_SUPER_ATTR (#109289)Carl Meyer2023-09-111-0/+4
|
* gh-109179: Fix traceback display for SyntaxErrors with notes (#109197)Irit Katriel2023-09-111-0/+1
|
* gh-109276: libregrtest: use separated file for JSON (#109277)Victor Stinner2023-09-111-0/+3
| | | | | | | | | | | | | | libregrtest now uses a separated file descriptor to write test result as JSON. Previously, if a test wrote debug messages late around the JSON, the main test process failed to parse JSON. Rename TestResult.write_json() to TestResult.write_json_into(). worker_process() no longer writes an empty line at the end. There is no need to separate test process output from the JSON output anymore, since JSON is now written into a separated file descriptor. create_worker_process() now always spawn the process with close_fds=True.
* gh-108987: Fix _thread.start_new_thread() race condition (#109135)Victor Stinner2023-09-111-0/+4
| | | | | | | | | | | | | Fix _thread.start_new_thread() race condition. If a thread is created during Python finalization, the newly spawned thread now exits immediately instead of trying to access freed memory and lead to a crash. thread_run() calls PyEval_AcquireThread() which checks if the thread must exit. The problem was that tstate was dereferenced earlier in _PyThreadState_Bind() which leads to a crash most of the time. Move _PyThreadState_CheckConsistency() from thread_run() to _PyThreadState_Bind().
* GH-108976. Keep monitoring data structures valid during de-optimization ↵Mark Shannon2023-09-111-0/+2
| | | | during callback. (GH-109131)
* gh-107219: Fix concurrent.futures terminate_broken() (#109244)Victor Stinner2023-09-111-0/+5
| | | | | | | | | | | | | | | Fix a race condition in concurrent.futures. When a process in the process pool was terminated abruptly (while the future was running or pending), close the connection write end. If the call queue is blocked on sending bytes to a worker process, closing the connection write end interrupts the send, so the queue can be closed. Changes: * _ExecutorManagerThread.terminate_broken() now closes call_queue._writer. * multiprocessing PipeConnection.close() now interrupts WaitForMultipleObjects() in _send_bytes() by cancelling the overlapped operation.
* gh-109230: test_pyexpat no longer depends on the current directory (#109233)Victor Stinner2023-09-101-0/+5
| | | | | | | | Fix test_pyexpat.test_exception(): it can now be run from a directory different than Python source code directory. Before, the test failed in this case. Skip the test if Modules/pyexpat.c source is not available. Skip also the test on Python implementations other than CPython.
* gh-109237: Fix test_site for non-ASCII working directory (#109238)Victor Stinner2023-09-101-0/+4
| | | | | | Fix test_site.test_underpth_basic() when the working directory contains at least one non-ASCII character: encode the "._pth" file to UTF-8 and enable the UTF-8 Mode to use UTF-8 for the child process stdout.
* gh-50644: Forbid pickling of codecs streams (GH-109180)Serhiy Storchaka2023-09-101-0/+4
| | | | | | | | | Attempts to pickle or create a shallow or deep copy of codecs streams now raise a TypeError. Previously, copying failed with a RecursionError, while pickling produced wrong results that eventually caused unpickling to fail with a RecursionError.
* gh-109207: Fix SystemError when printing symtable entry object. (GH-109225)云line2023-09-101-0/+1
|
* gh-93627: Align Python implementation of pickle with C implementation of ↵Pieter Eendebak2023-09-101-0/+1
| | | | | pickle (GH-103035) If a method like __reduce_ex_ or __reduce__ is set to None, a TypeError is raised.
* gh-109174: Add support of SimpleNamespace in copy.replace() (GH-109175)Serhiy Storchaka2023-09-101-0/+1
|
* gh-109118: Fix runtime crash when NameError happens in PEP 695 function ↵Jelle Zijlstra2023-09-091-0/+2
| | | | (#109123)
* gh-109052: Use the base opcode when comparing code objects (gh-109107)Tian Gao2023-09-091-0/+1
|
* gh-108996: add tests for msvcrt (#109004)AN Long2023-09-081-0/+1
| | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Steve Dower <steve.dower@microsoft.com>
* gh-109054: configure checks if libatomic is needed (#109101)Victor Stinner2023-09-081-0/+6
| | | | | | | | | | | | | | | | Fix building the _testcapi extension on Linux AArch64 which requires linking to libatomic when <cpython/pyatomic.h> is used: the _Py_atomic_or_uint64() function requires libatomic __atomic_fetch_or_8() on this platform. The configure script now checks if linking to libatomic is needed and generates a new LIBATOMIC variable used to build the _testcapi extension. Building the _testcapi extension now uses the LIBATOMIC variable in its LDFLAGS, since Modules/_testcapi/pyatomic.c uses <cpython/pyatomic.h>. Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-109114: Relax the check for invalid lambdas inside f-strings to avoid ↵Pablo Galindo Salgado2023-09-081-0/+3
| | | | false positives (#109121)
* gh-106922: Fix error location for constructs with spaces and parentheses ↵Pablo Galindo Salgado2023-09-081-0/+2
| | | | (#108959)