Commit Graph

123513 Commits

Author SHA1 Message Date
Barney Gale 625d0705b9
GH-73991: Add `pathlib.Path.move()` (#122073)
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.
2024-08-25 16:51:51 +01:00
CF Bolz-Tereick aa905925e1
gh-123228: don't leak file descriptors in pyrepl test (#123302) 2024-08-25 15:52:51 +01:00
Adam Turner 74ff496dce
GH-109975: Copyedit 3.13 What's New: Optimizations (#123301) 2024-08-25 16:17:46 +03:00
Adam Turner 9b3749849e
GH-123299: Move ctypes What's New entry to 3.14 (#123300) 2024-08-25 01:41:44 +01:00
Shantanu 52caaef6d0
Revert "GH-120754: Add a strace helper and test set of syscalls for o… (#123303)
Revert "GH-120754: Add a strace helper and test set of syscalls for open().read() (#121143)"

This reverts commit e38d0afe35.
2024-08-24 21:54:31 +00:00
Cody Maloney e38d0afe35
GH-120754: Add a strace helper and test set of syscalls for open().read() (#121143) 2024-08-24 13:42:41 -07:00
Anthony Shaw 86f06cb3fb
Remove comment from pystate created in 2003 (#123259) 2024-08-24 20:36:42 +00:00
Sergey B Kirpichev ca18ff2a34
gh-123228: fix return type for _ReadlineWrapper.get_line_buffer() (#123281)
Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
2024-08-24 17:46:05 +02:00
Barney Gale c4ee4e756a
GH-122890: Fix low-level error handling in `pathlib.Path.copy()` (#122897)
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`
2024-08-24 15:11:39 +01:00
Adam Turner 127660bcdb
GH-109975: Copyedit 3.13 What's New: Improved Modules (#123132)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2024-08-24 14:32:35 +01:00
Adam Turner b178beef26
Docs: Fix Makefile syntax (#123287) 2024-08-24 12:57:38 +00:00
neonene 5ff638f1b5
gh-123243: Fix reference leak in `_decimal` (#123244) 2024-08-24 09:37:01 +05:30
Sam Gross 556e855684
gh-117376: Make `Py_DECREF` a macro in ceval.c in free-threaded build (#122975)
`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.
2024-08-23 15:36:14 -04:00
Kirill Podoprigora 67f2c84bff
gh-123205: `Python/bytecodes.c`: Fix compiler warning (#123206)
Fix MSVC warning "conversion from '__int64' to 'int'"
2024-08-23 15:35:25 -04:00
Barney Gale d7ae4dc5c1
GH-73991: Disallow copying directory into itself via `pathlib.Path.copy()` (#122924) 2024-08-23 20:03:11 +01:00
Irit Katriel bf1b5d323b
gh-121404: more compiler_* -> codegen_*, class_body and comprehensions (#123262) 2024-08-23 19:53:15 +01:00
Kevin Evans 58fdb169c8
Fix typo mentioning threads instead of tasks (#123203) 2024-08-23 21:54:12 +05:30
blhsing 126910edba
gh-122272: Guarantee specifiers %F and %C for datetime.strftime to be 0-padded (GH-122436) 2024-08-23 18:45:03 +03:00
Mark Shannon 7cd3aa42f0
GH-122298: Restore printing of GC stats (GH-123261) 2024-08-23 16:39:08 +01:00
Pablo Galindo Salgado adc5190014
gh-123229: Fix valgrind warning by initializing the f-string buffers to 0 in the tokenizer (#123263)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2024-08-23 12:33:45 +00:00
Mark Shannon 0b0f7befad
GH-123232: Fix "not specialized" stats (GH-123236) 2024-08-23 10:46:03 +01:00
Irit Katriel 5fce482c9a
gh-121404: compiler_annassign --> codegen_annassign (#123245) 2024-08-23 10:39:42 +01:00
Mark Shannon 5d3201fe3f
GH-123040: Specialize shadowed `LOAD_ATTR`. (GH-123219) 2024-08-23 10:22:35 +01:00
Bar Harel 90b6d0e0f8
gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214) 2024-08-23 12:12:58 +03:00
Jonathan Protzenko a64aa47302
GH-99108: Amend Modules/Setup (#123146) 2024-08-23 08:40:31 +02:00
Sergey B Kirpichev 4c3f0cbeae
gh-122546: Relax SyntaxError check when raising errors on the new REPL (#123233) 2024-08-23 00:25:33 +01:00
Donghee Na 297f2e093e
gh-123083: Fix a potential use-after-free in ``STORE_ATTR_WITH_HINT`` (gh-123092) 2024-08-22 23:49:09 +09:00
Irit Katriel 4abc1c1456
gh-121404: remove redundant c_nestlevel. more compiler abstractions. more macro usage consistency (#123225) 2024-08-22 15:08:16 +01:00
Bénédikt Tran 31acc4d243
gh-123165: correct tests for `dis.dis(func, show_positions=True)` (#123220) 2024-08-22 14:30:31 +01:00
Mark Shannon a3d8c0542e
GH-123197: Only count an instruction as deferred if it hasn't deopted first. (GH-123222)
Only count an instruction as deferred if hasn't deopted first.
2024-08-22 14:17:10 +01:00
Sergey B Kirpichev 3d7b1a526d
gh-122546: use same filename for different exceptions in new repl (#123217)
* gh-122546: use same filename for different exceptions in new repl

* +1
2024-08-22 12:55:30 +01:00
Brandt Bucher 427b106162
GH-118093: Specialize calls to non-vectorcall classes as `CALL_NON_PY_GENERAL` (GH-123212)
Specialize classes without vectorcall as CALL_NON_PY_GENERAL
2024-08-22 11:50:55 +01:00
mpage 79ddf75710
gh-122712: Test `CALL_ALLOC_AND_ENTER_INIT` handles reassignment of `__code__` (GH-122713) 2024-08-22 08:38:04 +01:00
Irit Katriel ec89620e5e
gh-123142: Fix too wide source locations in tracebacks of exceptions from broken iterables in comprehensions (#123173) 2024-08-21 19:12:05 +01:00
Mark Shannon a4fd7aa4a6
GH-115776: Allow any fixed sized object to have inline values (GH-123192) 2024-08-21 15:52:04 +01:00
Irit Katriel 4b7c4880a0
gh-121404: split fblock handling into compiler_* and codegen_* parts (#123199) 2024-08-21 15:48:56 +01:00
Bénédikt Tran b1d3bd2e09
gh-123165: make `dis` functions render positions on demand (#123168) 2024-08-21 14:46:24 +01:00
Wulian 94036e43a8
Fix typos in comments (#123201) 2024-08-21 12:49:23 +00:00
Mark Shannon 7b26c4d1e3
GH-123197: Increment correct stat for CALL_KW (GH-123200) 2024-08-21 12:52:28 +01:00
Mark Shannon 1eba8bae92
GH-123185: Check for `NULL` after calling `_PyEvalFramePushAndInit` (GH-123194) 2024-08-21 12:44:56 +01:00
Serhiy Storchaka 90c892efea
gh-85110: Preserve relative path in URL without netloc in urllib.parse.urlunsplit() (GH-123179) 2024-08-21 10:17:38 +03:00
Peter Bierma 9dbd123755
gh-123084: Turn `shutil.ExecError` into a deprecated alias of `RuntimeError` (#123125) 2024-08-21 00:39:24 +00:00
Serhiy Storchaka f88c14d412
gh-122981: Fix inspect.getsource() for generated classes with Python base classes (GH-123001)
Look up __firstlineno__ only in the class' dict, without searching in
base classes.
2024-08-20 20:10:15 +03:00
Mark Shannon bb1d30336e
GH-118093: Make `CALL_ALLOC_AND_ENTER_INIT` suitable for tier 2. (GH-123140)
* Convert CALL_ALLOC_AND_ENTER_INIT to micro-ops such that tier 2 supports it

* Allow inexact arguments for CALL_ALLOC_AND_ENTER_INIT.
2024-08-20 16:52:58 +01:00
Irit Katriel bffed80230
gh-123048: Fix missing source location in pattern matching code (#123167) 2024-08-20 11:39:41 +01:00
Jeremy Hylton 77133f570d
gh-122909: Pass ftp error strings to URLError constructor (#122913)
* pass the original string error message from the ftplib error to URLError()

* Update request.py

Change error string for ftp error to be consistent with other errors reported for ftp

* Add NEWS entry for change to urllib.request for ftp errors.

* Track the change in the ftp error message in the test.
2024-08-20 00:35:05 +00:00
Jelle Zijlstra 0480052ea1
gh-109975: Copyedit What's New in Python 3.13 (#123150)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-19 23:51:37 +00:00
James 833c58b81e
gh-123149: Suppress verbose repr in new REPL (#123151) 2024-08-19 20:04:38 +01:00
Pablo Galindo Salgado 48856ead6a
gh-123123: Fix display of syntax errors covering multiple lines (#123131)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2024-08-19 15:09:03 +00:00
Irit Katriel b6d0a40a42
gh-121404: rename functions to use codegen_* prefix. Use macros more consistently. (#123139) 2024-08-19 14:39:53 +00:00