summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* gh-119180: Update the magic number (#119397)Jelle Zijlstra2024-05-252-1/+2
| | | | PR #119321 added a comment about the magic number bump but did not actually apply the new magic number.
* Misc improvement to the docs for itertools (gh-119529)Raymond Hettinger2024-05-241-55/+55
|
* GH-119054: Add "Querying file type and status" section to pathlib docs (#119055)Barney Gale2024-05-241-167/+171
| | | | Add a dedicated subsection for `Path.stat()`-related methods, specifically `stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.
* Regen ``Doc/requirements-oldest-sphinx.txt`` (#119520)Kirill Podoprigora2024-05-241-1/+1
|
* gh-118263: Add additional arguments to path_t (Argument Clinic type) in ↵Nice Zombies2024-05-247-359/+389
| | | | posixmodule (GH-118355)
* gh-112075: Fix dict thread safety issues (#119288)Germán Méndez Bravo2024-05-241-25/+41
| | | Fix dict thread safety issues
* GH-119496: accept UTF-8 BOM in .pth files (GH-119503)Alyssa Coghlan2024-05-241-1/+3
| | | | | | | | | | `Out-File -Encoding utf8` and similar commands in Windows Powershell 5.1 emit UTF-8 with a BOM marker, which the regular `utf-8` codec decodes incorrectly. `utf-8-sig` accepts a BOM, but also works correctly without one. This change also makes .pth files match the way Python source files are handled. Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* gh-69214: Fix fcntl.ioctl() request type (#119498)Victor Stinner2024-05-243-8/+12
| | | | Use an 'unsigned long' instead of an 'unsigned int' for the request parameter of fcntl.ioctl() to support requests larger than UINT_MAX.
* GH-113464: Run the JIT interpreter before any other JIT CI (GH-119466)Brandt Bucher2024-05-241-0/+15
|
* gh-119317: findall instead of traverse for docutils nodes (#119319)Carlos Meza2024-05-242-4/+4
|
* Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)Petr Viktorin2024-05-232-2/+2
|
* gh-119461: Fix ThreadedVSOCKSocketStreamTest (#119465)Victor Stinner2024-05-233-4/+8
| | | | | | | | | | Add socket.VMADDR_CID_LOCAL constant. Fix ThreadedVSOCKSocketStreamTest: if get_cid() returns the host address or the "any" address, use the local communication address (loopback): VMADDR_CID_LOCAL. On Linux 6.9, apparently, the /dev/vsock device is now available but get_cid() returns VMADDR_CID_ANY (-1).
* gh-118727: Don't drop the GIL in `drop_gil()` unless the current thread ↵Brett Simmers2024-05-235-55/+68
| | | | | | | | | | | | | | | | | holds it (#118745) `drop_gil()` assumes that its caller is attached, which means that the current thread holds the GIL if and only if the GIL is enabled, and the enabled-state of the GIL won't change. This isn't true, though, because `detach_thread()` calls `_PyEval_ReleaseLock()` after detaching and `_PyThreadState_DeleteCurrent()` calls it after removing the current thread from consideration for stop-the-world requests (effectively detaching it). Fix this by remembering whether or not a thread acquired the GIL when it last attached, in `PyThreadState._status.holds_gil`, and check this in `drop_gil()` instead of `gil->enabled`. This fixes a crash in `test_multiprocessing_pool_circular_import()`, so I've reenabled it.
* gh-117398: Statically Allocate the Datetime C-API (GH-119472)Eric Snow2024-05-233-35/+89
|
* gh-119469: Fix _pyrepl reference leaks (#119470)Łukasz Langa2024-05-232-12/+30
|
* gh-117142: Slightly hacky fix for memory leak of StgInfo (GH-119424)Petr Viktorin2024-05-232-53/+45
| | | | | | | | | | | | Add a funciton that inlines PyObject_GetTypeData and skips type-checking, so it doesn't need access to the CType_Type object. This will break if the memory layout changes, but should be an acceptable solution to enable ctypes in subinterpreters in Python 3.13. Mark _ctypes as safe for multiple interpreters Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220)Mark Shannon2024-05-233-2/+9
|
* gh-119431: fix refleak in test_monitoring (#119444)Irit Katriel2024-05-231-0/+1
|
* Fix typos in what's new documentation (#119448)Xie Yanbo2024-05-236-9/+9
|
* Tiny fix: Update link for HAC algorithm (gh-118546)Ayato Hayashi2024-05-231-2/+2
|
* gh-119105: difflib.py Differ.compare is too slow [for degenerate cases] ↵Tim Peters2024-05-222-59/+89
| | | | | (#119376) Track all pairs achieving the best ratio in Differ(). This repairs the "very deep recursion and cubic time" bad cases in a way that preserves previous output.
* gh-119434: Fix culmitive errors in wrapping as lines proceed (#119435)Dino Viehland2024-05-221-3/+9
| | | Fix culmitive errors in wrapping as lines proceed
* gh-119396: Optimize PyUnicode_FromFormat() UTF-8 decoder (#119398)Victor Stinner2024-05-221-62/+141
| | | | | | | | | | | | | | | | | Add unicode_decode_utf8_writer() to write directly characters into a _PyUnicodeWriter writer: avoid the creation of a temporary string. Optimize PyUnicode_FromFormat() by using the new unicode_decode_utf8_writer(). Rename unicode_fromformat_write_cstr() to unicode_fromformat_write_utf8(). Microbenchmark on the code: return PyUnicode_FromFormat( "%s %s %s %s %s.", "format", "multiple", "utf8", "short", "strings"); Result: 620 ns +- 8 ns -> 382 ns +- 2 ns: 1.62x faster.
* gh-111201: Use calc_complete_screen after bracketed paste in PyREPL (#119432)Lysandros Nikolaou2024-05-221-0/+1
|
* gh-117142: ctypes: Clean up c-analyzer .tsv files (GH-117544)neonene2024-05-223-53/+0
| | | Co-authored-by: Petr Viktorin <encukou@gmail.com>
* gh-70795: Rework RLock documentation (#103853)uıɐɾ ʞ ʇɐɯɐs2024-05-221-24/+51
| | | | | | | | | | | | | | | | Attempted to simultaneously reduce verbosity, while more descriptively describing behavior. Fix links (RLock acquire/release previously linking to Lock acquire/release, seems like bad copy pasta). Add a seealso for with-locks. Switch section to use bullet points. --------- Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com> Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* gh-117505: Run ensurepip in isolated env in Windows installer (GH-118257)Michael Vincent2024-05-222-2/+3
| | | ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
* gh-119247: Add macros to use PySequence_Fast safely in free-threaded build ↵Josh {*()} Rosenberg2024-05-224-3/+106
| | | | | | | | (#119315) Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and `Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use them. Also add a regression test that would crash reliably without this patch.
* gh-117657: Fix missing atomic in dict_resize (#119312)Dino Viehland2024-05-221-1/+1
| | | Fix missing atomic in dict_resize
* Remove almost all unpaired backticks in docstrings (#119231)Geoffrey Thomas2024-05-2239-172/+172
| | | | | | | | | | | | | | | | | | As reported in #117847 and #115366, an unpaired backtick in a docstring tends to confuse e.g. Sphinx running on subclasses of standard library objects, and the typographic style of using a backtick as an opening quote is no longer in favor. Convert almost all uses of the form The variable `foo' should do xyz to The variable 'foo' should do xyz and also fix up miscellaneous other unpaired backticks (extraneous / missing characters). No functional change is intended here other than in human-readable docstrings.
* gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters ↵Eric Snow2024-05-2210-3/+144
| | | | | | | | | (gh-119331) _PyArg_Parser holds static global data generated for modules by Argument Clinic. The _PyArg_Parser.kwtuple field is a tuple object, even though it's stored within a static global. In some cases the tuple is statically allocated and thus it's okay that it gets shared by multiple interpreters. However, in other cases the tuple is set lazily, allocated from the heap using the active interprepreter at the point the tuple is needed. This is a problem once that interpreter is destroyed since _PyArg_Parser.kwtuple becomes at dangling pointer, leading to crashes. It isn't a problem if the tuple is allocated under the main interpreter, since its lifetime is bound to the lifetime of the runtime. The solution here is to temporarily switch to the main interpreter. The alternative would be to always statically allocate the tuple. This change also fixes a bug where only the most recent parser was added to the global linked list.
* gh-119391: Amend comment description of PyMapping_Items, PyMapping_Values ↵Pieter Eendebak2024-05-221-3/+3
| | | | | and PyMapping_Keys (#119392) The behaviour was changed in 0ccc0f6c7.
* gh-118643: Fix AttributeError in the email module (GH-119099)Serhiy Storchaka2024-05-223-5/+24
| | | | | | | | Fix regression introduced in gh-100884: AttributeError when re-fold a long address list. Also fix more cases of incorrect encoding of the address separator in the address list missed in gh-100884.
* Fix version number in use_load_tests deprecation reference (GH-119151)Jacob Walls2024-05-221-1/+1
| | | Deprecation took place in d78742a260ba09e53c844de7b1fd11a11c674945 (3.5)
* Fix typos in NEWS entries for 3.13 (GH-119374)Xie Yanbo2024-05-222-17/+17
|
* Clarify that dklen is expected in bytes for the hashlib functions (GH-106624)Mathijs Mortimer2024-05-221-2/+2
|
* DOCS: fix error in exec namespace note (gh-119378)Alyssa Coghlan2024-05-221-4/+0
| | | | | | When updating the new exec note added in gh-119235 as part of the PEP 667 general docs PR, I suggested a workaround that isn't valid. The first half of the note is still reasonable, so just omit the invalid text.
* gh-118911: Trailing whitespace in a block shouldn't prevent the user from ↵Aya Elsayed2024-05-225-9/+79
| | | | | terminating the code block (#119355) Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-111201: Speed up paste mode in the REPL (#119341)Pablo Galindo Salgado2024-05-226-16/+21
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-111201: auto-indentation in _pyrepl (#119348)Arnon Yaari2024-05-222-58/+179
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-119180: PEP 649: Add __annotate__ attributes (#119209)Jelle Zijlstra2024-05-2213-18/+324
|
* gh-119357: Increase test coverage for keymap in _pyrepl (#119358)Eugene Triguba2024-05-223-53/+94
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-111201: Add append to screen method to avoid recalculation (#119274)Lysandros Nikolaou2024-05-224-14/+43
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-60191: Implement ast.compare (#19211)Batuhan Taskaya2024-05-225-5/+210
| | | | | | | | | | * bpo-15987: Implement ast.compare Add a compare() function that compares two ASTs for structural equality. There are two set of attributes on AST node objects, fields and attributes. The fields are always compared, since they represent the actual structure of the code. The attributes can be optionally be included in the comparison. Attributes capture things like line numbers of column offsets, so comparing them involves test whether the layout of the program text is the same. Since whitespace seems inessential for comparing ASTs, the default is to compare fields but not attributes. ASTs are just Python objects that can be modified in arbitrary ways. The API for ASTs is under-specified in the presence of user modifications to objects. The comparison respects modifications to fields and attributes, and to _fields and _attributes attributes. A user could create obviously malformed objects, and the code will probably fail with an AttributeError when that happens. (For example, adding "spam" to _fields but not adding a "spam" attribute to the object.) Co-authored-by: Jeremy Hylton <jeremy@alum.mit.edu>
* gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with ↵Landon Wood2024-05-221-3/+3
| | | | docstrings (#119330)
* gh-119180: Add LOAD_COMMON_CONSTANT opcode (#119321)Jelle Zijlstra2024-05-2222-288/+337
| | | | | | | | | | The PEP 649 implementation will require a way to load NotImplementedError from the bytecode. @markshannon suggested implementing this by converting LOAD_ASSERTION_ERROR into a more general mechanism for loading constants. This PR adds this new opcode. I will work on the rest of the implementation of the PEP separately. Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* gh-119205: Fix autocompletion bug in new repl (#119229)Koudai Aono2024-05-213-8/+28
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* gh-118893: Evaluate all statements in the new REPL separately (#119318)Pablo Galindo Salgado2024-05-215-9/+128
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* Docs: Add central references to free-threading-related options (#119017)Brett Simmers2024-05-214-6/+8
|
* gh-118692: Avoid creating unnecessary StopIteration instances for monitoring ↵Irit Katriel2024-05-2110-35/+60
| | | | (#119216)