Commit Graph

13378 Commits

Author SHA1 Message Date
smij720 967a4f1d18
Docs: Change `remove` to `removes` for consistency (#121072) 2024-08-07 16:30:00 +01:00
Barney Gale 98dba73010
GH-73991: Rework `pathlib.Path.rmtree()` into `delete()` (#122368)
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.)
2024-08-07 01:34:44 +01:00
Sam Gross 1429651a06
gh-121103: Update site module docs for free-threaded installs (#122737)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-08-06 14:34:34 -04:00
Kirill Podoprigora 8ce70d6c69
gh-122058: `Lib/inspect`: Update docstrings for `isfunction`, `isgenerator`, `isframe`, `iscode`. (#122059)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-08-06 14:47:31 +02:00
Irit Katriel 1422500d02
gh-121367: [doc] BUILD_TUPLE arg can be 0 (#122663) 2024-08-05 10:17:55 +01:00
scottwoodall 06eb9701a1
Doc: Grammar fix in ``library/ssl.rst``, 'Verifying certificates' (#122646) 2024-08-03 14:24:29 +01:00
Matth-M 7a5c4103b0
Doc: Improve wording of ``os.path.commonpath()`` (#122627)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-03 11:18:59 +00:00
Bénédikt Tran fb864c76cd
gh-121723: Relax constraints on queue objects for `logging.handlers.QueueHandler`. (GH-122154) 2024-08-02 12:16:32 +01:00
jianghuyiyuan 46f5a4f9e1
Fix typos in docs, error messages and comments (#122502)
Signed-off-by: jianghuyiyuan <shuangcui@live.com>
2024-08-01 00:26:09 +00:00
Cody Maloney a9344cdffa
gh-121381 Remove subprocess._USE_VFORK escape hatch (#121383)
This flag was added as an escape hatch in gh-91401 and backported to
Python 3.10. The flag broke at some point between its addition and now.
As there is currently no publicly known environments that require this,
remove it rather than work on fixing it.

This leaves the flag in the subprocess module to not break code which
may have used / checked the flag itself.

discussion: https://discuss.python.org/t/subprocess-use-vfork-escape-hatch-broken-fix-or-remove/56915/2
2024-07-30 18:39:54 -07:00
Petr Viktorin 0976339818
gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)
## Encode header parts that contain newlines

Per RFC 2047:

> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects

It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.


## Verify that email headers are well-formed

This should fail for custom fold() implementations that aren't careful
about newlines.


Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-31 00:19:48 +02:00
Petr Viktorin 3833d27f98
gh-105733: Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it. (GH-122281)
Soft-deprecate ctypes.ARRAY, rather than hard-deprecating it.

Partially reverts 2211454fe2
2024-07-30 09:37:58 +02:00
Barney Gale cbac8a3888
GH-121462: pathlib docs: improve table of corresponding os/os.path functions (#121465)
Re-order table of corresponding functions with the following priorities:

1. Pure functionality is at the top
2. `os.path` functions are shown before `os` functions
3. Similar functionality is kept together
4. Functionality follows docs order where possible

Add a few missed correspondences:

- `os.path.isjunction` and `Path.is_junction`
- `os.path.ismount` and `Path.is_mount`
- `os.lstat()` and `Path.lstat()`
- `os.lchmod()` and `Path.lchmod()`

Also add footnotes describing a few differences.
2024-07-27 18:03:18 +01:00
Subrahmanya Gaonkar d52726ccd4
Document ``mimetypes.MimeTypes.add_type()`` (#122301)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-26 22:03:08 +00:00
Pablo Galindo Salgado db2d8b6db1
gh-122300: Preserve AST nodes for format specifiers with single elements (#122308) 2024-07-26 16:29:41 +00:00
WilliamRoyNelson dcafb362f7
gh-121999: Change default tarfile filter to 'data' (GH-122002)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
Co-authored-by: Scott Odle <scott@sjodle.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-07-26 16:34:13 +02:00
Mark Shannon 2c42e13e80
GH-116090: Fix test and clarify behavior for exception events when exhausting a generator. (GH-120697) 2024-07-26 14:37:35 +01:00
Mark Shannon 2e14a52cce
GH-122160: Remove BUILD_CONST_KEY_MAP opcode. (GH-122164) 2024-07-25 16:24:29 +01:00
Ville Skyttä 498cb6dff1
Docs: Use cross-reference to `os.uname` in `sysconfig.get_platform` (#122083) 2024-07-23 14:08:39 +01:00
Bénédikt Tran c09d4c4a26
gh-119698: deprecate ``symtable.Class.get_methods`` (#121902) 2024-07-22 07:04:17 -07:00
Łukasz Langa dc93d1125f
gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958)
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
2024-07-22 13:04:08 +02:00
Ville Skyttä bc264eac3a
Docs: spelling and grammar fixes (#122084)
Corrected some grammar and spelling issues in documentation.

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 09:14:25 +08:00
Russell Keith-Magee 728432c804
gh-120522: Apply App Store compliance patch during installation (#121947)
Adds a --with-app-store-compliance configuration option that patches out code known to be an issue with App Store review processes. This option is applied automatically on iOS, and optionally on macOS.
2024-07-22 07:36:08 +08:00
Andrey Mishchenko 0dcbc83853
Delete stale note about mp.Lock.acquire/SIGINT (#120929) 2024-07-21 06:17:57 +00:00
Raymond Hettinger ebc18abbf3
gh-121977: Add tips for handling unhashable data (#122075) 2024-07-21 05:53:26 +00:00
Barney Gale c4c7097e64
GH-73991: Support preserving metadata in `pathlib.Path.copytree()` (#121438)
Add *preserve_metadata* keyword-only argument to `pathlib.Path.copytree()`,
defaulting to false. When set to true, we copy timestamps, permissions,
extended attributes and flags where available, like `shutil.copystat()`.
2024-07-20 23:32:52 +01:00
Barney Gale 094375b9b7
GH-73991: Add `pathlib.Path.rmtree()` (#119060)
Add a `Path.rmtree()` method that removes an entire directory tree, like
`shutil.rmtree()`. The signature of the optional *on_error* argument
matches the `Path.walk()` argument of the same name, but differs from the
*onexc* and *onerror* arguments to `shutil.rmtree()`. Consistency within
pathlib is probably more important.

In the private pathlib ABCs, we add an implementation based on `walk()`.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-20 20:14:13 +00:00
Adam Turner 8db5f48007
Docs: Fix duplicate object description warnings (#122068) 2024-07-20 19:46:41 +00:00
Rodrigo Oliveira d66b06107b
gh-118830: Bump pickle.DEFAULT_PROTOCOL to 5 (GH-119340) 2024-07-19 16:47:10 +02:00
Petr Viktorin 709db44255
gh-121160: Note that readline libraries using different history formats. (GH-121327)
This is not something we can do too much about, without help from the
underlying libraries.
2024-07-19 15:52:00 +02:00
Serhiy Storchaka 1a0c7b9ba4
gh-121905: Consistently use "floating-point" instead of "floating point" (GH-121907) 2024-07-19 08:06:02 +00:00
Kirill Podoprigora 98e5bdef0e
Docs: Fix typo in description of ``INTRINSIC_ASYNC_GEN_WRAP`` (#122004) 2024-07-19 08:30:01 +01:00
Serhiy Storchaka c8d2630995
gh-82017: Support as_integer_ratio() in the Fraction constructor (GH-120271)
Any objects that have the as_integer_ratio() method (e.g. numpy.float128)
can now be converted to a fraction.
2024-07-19 08:06:53 +03:00
Vlastimil Zíma 94e6644584
gh-65453: Docs - clarify AttributeError behaviour on PropertyMock (GH-121666)
Fixed at EuroPython 24 sprints.
2024-07-18 15:57:21 +02:00
Bernhard M. Wiedemann 24cf867bed
gh-121874: Define audit-event open parameters consistently (GH-121883)
Use same names for parameters to avoid triggering a race-condition in Sphinx
that causes non-deterministic output.
2024-07-18 13:05:39 +03:00
Zachary Ware 4e35dd607b
gh-83648: Use versionadded in 'deprecated' description (GH-121877) 2024-07-16 21:26:17 +00:00
Pablo Galindo Salgado c46d64e0ef
gh-121130: Fix f-string format specifiers with debug expressions (#121150) 2024-07-16 19:57:22 +01:00
Andreas Stocker 8f2532168b
gh-59022: Added tests for `pkgutil.extend_path` (#59022) (GH-121673)
This adds tests for the documented behaviour of `pkgutil.extend_path`
regarding different argument types as well as for `*.pkg` files.
2024-07-16 17:14:26 +02:00
Ned Deily f27593a87c
gh-120522: Revert "Add a `--with-app-store-compliance` configure option to patch out problematic code" (gh-120984) (#121844)
This reverts commit 48cd104b0c prior
to the release of 3.13.0b4 to allow for additional review time.
2024-07-16 06:49:36 -04:00
edson duarte 1755df7b3b
gh-85453: Fix 'timezone' vs. 'time zone' spelling issues in datetime.rst (#118449) 2024-07-16 10:17:00 +02:00
Serhiy Storchaka 94bee45dee
gh-84978: Add float.from_number() and complex.from_number() (GH-26827)
They are alternate constructors which only accept numbers
(including objects with special methods __float__, __complex__
and __index__), but not strings.
2024-07-15 16:07:00 +00:00
Dominic H 8303d32ff5
gh-117765: Improve documentation for `mocker.patch.dict` (#121755) 2024-07-15 07:14:17 +00:00
Jelle Zijlstra 50eec501fe
gh-57141: Make shallow argument to filecmp.dircmp keyword-only (#121767)
It is our general practice to make new optional parameters keyword-only,
even if the existing parameters are all positional-or-keyword. Passing
this parameter as positional would look confusing and could be error-prone
if additional parameters are added in the future.
2024-07-14 15:53:32 -07:00
Jan Musílek f6f4022a35
gh-64308: Remove TestProgram from the unittest docs (GH-121675) 2024-07-14 10:57:12 +02:00
Ulrik Södergren b5805892d5
gh-73159 Added clarifications in multiprocessing docs on that objects are pickled. (GH-121686)
Added explicit comments about that objects are pickled when transmitted via multiprocessing queues and pipes.
2024-07-13 13:07:40 -07:00
mirelagrigoras 422855ad21
gh-120823: Fix doc for ftplib.FTP.retrbinary() (GH-121697)
Co-authored-by: Mirela Andreea GRIGORAS <magrigoras@bitdefender.com>
2024-07-13 16:16:26 +02:00
Timon Viola fc21781175
gh-96765: Update ConfigParser.read() docs with multi-file read example (#121664)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-13 12:47:05 +00:00
AN Long facf9862da
gh-121333: Clarify what is the default executor for asyncio.run_in_executor (#121335)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-07-09 14:52:07 +05:30
Hugo van Kemenade 006b53a42f
NEWS: Fix Sphinx warnings and increase threshold for new news nits (#121482)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-08 14:30:05 -06:00
CBerJun bf74db731b
gh-121461: Fix os.path.normpath documentation indentation (#121466) 2024-07-08 03:51:03 +00:00