summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* Fix typos in docs, error messages and comments (#123336)Wulian2024-08-2821-25/+25
| | | | Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* gh-120389: Add PyLong_FromInt64() and PyLong_AsInt64() (#120390)Victor Stinner2024-08-2813-2/+286
| | | | | | | | | | | | Add new functions to convert C <stdint.h> numbers from/to Python int: * PyLong_FromInt32() * PyLong_FromUInt32() * PyLong_FromInt64() * PyLong_FromUInt64() * PyLong_AsInt32() * PyLong_AsUInt32() * PyLong_AsInt64() * PyLong_AsUInt64()
* gh-122561: Clean up and microoptimize str.translate and charmap codec ↵Serhiy Storchaka2024-08-281-27/+43
| | | | | | | | (GH-122932) * Replace PyLong_AS_LONG() with PyLong_AsLong(). * Call PyLong_AsLong() only once per the replacement code. * Use PyMapping_GetOptionalItem() instead of PyObject_GetItem().
* gh-123254: Improve `tuple` C API docs with more info about errors (#123255)sobolevn2024-08-281-8/+16
| | | Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-123363: Show string value of CONTAINS_OP oparg in dis (#123387)Alexandr Mitin2024-08-283-0/+14
| | | Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* gh-123270: Replaced SanitizedNames with a more surgical fix. (#123354)Jason R. Coombs2024-08-273-71/+87
| | | Applies changes from zipp 3.20.1 and jaraco/zipp#124
* gh-123271: Make builtin zip method safe under free-threading (#123272)Pieter Eendebak2024-08-274-1/+61
| | | | | | | | | | | | | | | | The `zip_next` function uses a common optimization technique for methods that generate tuples. The iterator maintains an internal reference to the returned tuple. When the method is called again, it checks if the internal tuple's reference count is 1. If so, the tuple can be reused. However, this approach is not safe under the free-threading build: after checking the reference count, another thread may perform the same check and also reuse the tuple. This can result in a double decref on the items of the replaced tuple and a double incref (memory leak) on the items of the tuple being set. This adds a function, `_PyObject_IsUniquelyReferenced` that encapsulates the stricter logic necessary for the free-threaded build: the internal tuple must be owned by the current thread, have a local refcount of one, and a shared refcount of zero.
* gh-121404: split compiler_nameop into a codegen part and a compiler part ↵Irit Katriel2024-08-271-89/+101
| | | | (#123398)
* gh-109975: Fix a typo in What's New in Python 3.13 (#123393)Daniel Hollas2024-08-271-1/+1
|
* GH-117759: Document incremental GC (GH-123266)Mark Shannon2024-08-273-26/+69
| | | | | | * Update what's new * Update gc module docs and fix inconsistency in gc.get_objects
* gH-80788: remove old weakset workaround for thread safety (#123388)Kumar Aditya2024-08-271-17/+2
|
* gh-123089: Make weakref.WeakSet safe against concurrent mutations while it ↵Kumar Aditya2024-08-272-43/+11
| | | | | | | | | is being iterated (#123279) * Make `weakref.WeakSet` safe against concurrent mutations while it is being iterated. `_IterationGuard` is no longer used for `WeakSet`, it now relies on copying the underlying set which is an atomic operation while iterating so that it can be modified by other threads.
* gh-120426: Reword the glossary term "immortal" (GH-123191)Petr Viktorin2024-08-271-7/+5
| | | Reword the glossary term "immortal", mark it as an implementation detail
* gh-121404: compiler_visit_* --> codegen_visit_* (#123382)Irit Katriel2024-08-271-61/+49
|
* GH-123232: Factor BINARY_SLICE and STORE_SLICE to handle stats properly for ↵Mark Shannon2024-08-274-197/+229
| | | | tier 2. (GH-123381)
* GH-115775: Use `__static_attributes__` to initialize shared keys (GH-118468)Mark Shannon2024-08-273-3/+18
|
* Further revise idlelib/Icons/README.text (#123364)Terry Jan Reedy2024-08-261-10/+25
| | | In particular, add trademark derivative approval information.
* gh-122666: Tests for ast optimizations (#122667)Kirill Podoprigora2024-08-262-1/+213
| | | | | Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org> Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
* gh-123340: Show string value of `IS_OP` oparg in `dis` (#123348)sobolevn2024-08-263-0/+13
|
* GH-73991: Prune `pathlib.Path.copy()` and `copy_into()` arguments (#123337)Barney Gale2024-08-263-108/+21
| | | | | | | | | | | | | | | | Remove *ignore* and *on_error* arguments from `pathlib.Path.copy[_into]()`, because these arguments are under-designed. Specifically: - *ignore* is appropriated from `shutil.copytree()`, but it's not clear how it should apply when the user copies a non-directory. We've changed the callback signature from the `shutil` version, but I'm not confident the new signature is as good as it can be. - *on_error* is a generalisation of `shutil.copytree()`'s error handling, which is to accumulate exceptions and raise a single `shutil.Error` at the end. It's not obvious which solution is better. Additionally, this arguments may be challenging to implement in future user subclasses of `PathBase`, which might utilise a native recursive copying method.
* GH-73991: Make `pathlib.Path.delete()` private. (#123315)Barney Gale2024-08-267-287/+48
| | | | | | | | Per feedback from Paul Moore on GH-123158, it's better to defer making `Path.delete()` public than ship it with under-designed error handling capabilities. We leave a remnant `_delete()` method, which is used by `move()`. Any functionality not needed by `move()` is deleted.
* gh-111495: Remove test_capi test_rshift_print() (#123338)Victor Stinner2024-08-261-15/+0
| | | | The suggestion for "print >> value" was removed recently: commit 9375b9ca3a4998678ba74ff5c77ed540a4dcf887.
* gh-111495: Add tests for PyNumber C API (#111996)Sergey B Kirpichev2024-08-263-7/+496
|
* GH-73991: Add `pathlib.Path.copy_into()` and `move_into()` (#123314)Barney Gale2024-08-266-4/+96
| | | | | | | | | | | | These two methods accept an *existing* directory path, onto which we join the source path's base name to form the final target path. A possible alternative implementation is to check for directories in `copy()` and `move()` and adjust the target path, which is done in several `shutil` functions. This behaviour is helpful in a shell context, but less so in a stored program that explicitly specifies destinations. For example, a user that calls `Path('foo.py').copy('bar.py')` might not imagine that `bar.py/foo.py` would be created, but under the alternative implementation this will happen if `bar.py` is an existing directory.
* gh-111495: Add tests for PyTuple C API (#118757)Sergey B Kirpichev2024-08-2612-2/+528
| | | | | Co-authored-by: kalyanr <kalyan.ben10@live.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Victor Stinner <vstinner@python.org>
* Rewrite idlelib/Icons/README.txt (#123329)Terry Jan Reedy2024-08-261-8/+31
|
* gh-123177: Fix prompt for wrapped lines in pyrepl (#123324)Matt Wozniski2024-08-253-1/+42
| | | | | | | When display lines above the cursor come from the cache, the first line to not come from the cache may be a wrapped line, starting half way through a logical line in the buffer. Detect and handle this case to avoid accidentally drawing a stray prompt in the middle of a logical line.
* gh-82378: Document the difference between sys.tracebacklimit and the limit ↵CF Bolz-Tereick2024-08-251-0/+8
| | | | arguments (#123286)
* gh-123177: Deactivate line wrap for Apple Terminal via scape codes in the ↵Pablo Galindo Salgado2024-08-252-0/+10
| | | | new REPL (#123267)
* gh-123297: Propagate LD_FLAGS to LDCXXSHARED in sysconfig (#123298)Pablo Galindo Salgado2024-08-252-1/+3
|
* gh-122982: Extend the deprecation period for bool inversion by two years ↵Kirill Podoprigora2024-08-256-5/+8
| | | | (#123306)
* GH-73991: Add `pathlib.Path.move()` (#122073)Barney Gale2024-08-256-4/+225
| | | | | Add a `Path.move()` method that moves a file or directory tree, and returns a new `Path` instance pointing to the target. This method is similar to `shutil.move()`, except that it doesn't accept a *copy_function* argument, and it doesn't check whether the destination is an existing directory.
* gh-123228: don't leak file descriptors in pyrepl test (#123302)CF Bolz-Tereick2024-08-251-1/+1
|
* GH-109975: Copyedit 3.13 What's New: Optimizations (#123301)Adam Turner2024-08-251-14/+25
|
* GH-123299: Move ctypes What's New entry to 3.14 (#123300)Adam Turner2024-08-252-14/+24
|
* Revert "GH-120754: Add a strace helper and test set of syscalls for o… ↵Shantanu2024-08-244-280/+33
| | | | | | | (#123303) Revert "GH-120754: Add a strace helper and test set of syscalls for open().read() (#121143)" This reverts commit e38d0afe3548b856ccf0b05c01ed3eefc69cb3e7.
* GH-120754: Add a strace helper and test set of syscalls for open().read() ↵Cody Maloney2024-08-244-33/+280
| | | | (#121143)
* Remove comment from pystate created in 2003 (#123259)Anthony Shaw2024-08-241-5/+0
|
* gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (#123281)Sergey B Kirpichev2024-08-243-5/+13
| | | Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* GH-122890: Fix low-level error handling in `pathlib.Path.copy()` (#122897)Barney Gale2024-08-242-16/+90
| | | | | | | | | Give unique names to our low-level FD copying functions, and try each one in turn. Handle errors appropriately for each implementation: - `fcntl.FICLONE`: suppress `EBADF`, `EOPNOTSUPP`, `ETXTBSY`, `EXDEV` - `posix._fcopyfile`: suppress `EBADF`, `ENOTSUP` - `os.copy_file_range`: suppress `ETXTBSY`, `EXDEV` - `os.sendfile`: suppress `ENOTSOCK`
* GH-109975: Copyedit 3.13 What's New: Improved Modules (#123132)Adam Turner2024-08-242-355/+480
| | | Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* Docs: Fix Makefile syntax (#123287)Adam Turner2024-08-241-2/+2
|
* gh-123243: Fix reference leak in `_decimal` (#123244)neonene2024-08-242-2/+25
|
* gh-117376: Make `Py_DECREF` a macro in ceval.c in free-threaded build (#122975)Sam Gross2024-08-232-27/+53
| | | | | | | | | | | `Py_DECREF` and `PyStackRef_CLOSE` are now implemented as macros in the free-threaded build in ceval.c. There are two motivations; * MSVC has problems inlining functions in ceval.c in the PGO build. * We will want to mark escaping calls in order to spill the stack pointer in ceval.c and we will want to do this around `_Py_Dealloc` (or `_Py_MergeZeroLocalRefcount` or `_Py_DecRefShared`), not around the entire `Py_DECREF` or `PyStackRef_CLOSE` call.
* gh-123205: `Python/bytecodes.c`: Fix compiler warning (#123206)Kirill Podoprigora2024-08-233-3/+3
| | | Fix MSVC warning "conversion from '__int64' to 'int'"
* GH-73991: Disallow copying directory into itself via `pathlib.Path.copy()` ↵Barney Gale2024-08-232-14/+140
| | | | (#122924)
* gh-121404: more compiler_* -> codegen_*, class_body and comprehensions (#123262)Irit Katriel2024-08-231-59/+82
|
* Fix typo mentioning threads instead of tasks (#123203)Kevin Evans2024-08-231-3/+3
|
* gh-122272: Guarantee specifiers %F and %C for datetime.strftime to be ↵blhsing2024-08-237-14/+145
| | | | 0-padded (GH-122436)
* GH-122298: Restore printing of GC stats (GH-123261)Mark Shannon2024-08-232-0/+28
|