Commit Graph

28425 Commits

Author SHA1 Message Date
Erlend E. Aasland e006c7371d
gh-105201: Add PyIter_NextItem() (#122331)
Return -1 and set an exception on error; return 0 if the iterator is
exhausted, and return 1 if the next item was fetched successfully.

Prefer this API to PyIter_Next(), which requires the caller to use
PyErr_Occurred() to differentiate between iterator exhaustion and errors.

Co-authered-by: Irit Katriel <iritkatriel@yahoo.com>
2024-08-08 00:47:15 +02:00
smij720 967a4f1d18
Docs: Change `remove` to `removes` for consistency (#121072) 2024-08-07 16:30:00 +01:00
Wim Jeantine-Glenn c25898d51e
Doc: cmdline.rst: Include -P and -R in usage (#122590)
* ``-P``: safe path (https://docs.python.org/3/using/cmdline.html#cmdoption-P)
* ``-R``: hash randomization (https://docs.python.org/3/using/cmdline.html#cmdoption-R)
2024-08-07 16:01:44 +01:00
Bénédikt Tran 76bdeebef6
gh-122511: Improve documentation for object identity of mutable/immutable types (#122512)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-08-07 13:40:19 +00: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
Libor Martínek f5c39b3e9c
gh-122661: Remove GNU make-specific directive from Doc/Makefile (#122662) 2024-08-04 17:02:29 +03:00
sobolevn 151934a324
gh-122623: Improve `c-api/bytearray.rst` with error handling info (#122624) 2024-08-04 00:55:47 +03:00
Adam Turner 95f5c89b54
GH-121970: Fix ``gettext`` for audit events (#122651) 2024-08-03 17:41:26 +01:00
scottwoodall 06eb9701a1
Doc: Grammar fix in ``library/ssl.rst``, 'Verifying certificates' (#122646) 2024-08-03 14:24:29 +01:00
Sergey B Kirpichev d91ac525ef
gh-122613: Document PyLong_GetInfo() (part of Limited API) (GH-#122280) 2024-08-03 13:20:10 +02: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
Irit Katriel 498376d7a7
gh-122445: populate only modified fields in __static_attributes__ (#122446) 2024-08-02 15:40:42 +01: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
Victor Stinner addbb73927
Update PyObject_Del() documentation (#122597)
Replace PyMem_Del() with PyMem_Free().
2024-08-02 12:13:33 +02:00
Victor Stinner fda6bd842a
Replace PyObject_Del with PyObject_Free (#122453)
PyObject_Del() is just a alias to PyObject_Free() kept for backward
compatibility. Use directly PyObject_Free() instead.
2024-08-01 14:12:33 +02:00
Bénédikt Tran 88030861e2
gh-122555: Remove removed functions from `Doc/data/refcounts.dat` (#122556) 2024-08-01 12:26:09 +02:00
Rafael Fontenelle 58ffc4cf4a
gh-122384: Mark strings from Download page for translation (#122385)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-08-01 12:25:16 +03: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
Hugo van Kemenade d01fd24051
Docs: bump Sphinx to 8.0 and update constraints (#122496)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-31 07:02:08 +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
Thomas Grainger c68cb8e0c9
Remove outdated note about instance methods from datamodel.rst (#122471) 2024-07-30 12:42:25 -07: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
Adam Turner 11ad731f4f
GH-121970: Extract ``audit_events`` into a new extension (#122325) 2024-07-30 03:49:00 +00:00
Adam Turner 76bdfa4cd0
GH-122085: Use include files for C API deprecations (#109843) 2024-07-29 22:20:40 +01:00
Hugo van Kemenade aa449cf063
gh-122085: Create dedicated page for deprecations (#122352)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-28 10:53:21 +03: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
Hugo van Kemenade 4e75509349
gh-122085: Use include files for `whatsnew/3.14.rst` deprecations (#122242) 2024-07-27 14:17:54 +03:00
Adam Turner 762e771cc0
Fix underline for 'pty' in What's New in Python 3.14 (#122337) 2024-07-27 01:00:56 +00: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
Carol Willing 33586d64ca
Remove reference to docs mailing list for bug reports (#122323) 2024-07-26 13:56:39 -07: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
Irit Katriel bc94cf7e25
gh-122245: move checks for writes and shadowing of __debug__ to symtable (#122246) 2024-07-26 14:39:56 +01: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
Hugo van Kemenade b3b7b7d46a
gh-122085: Use include files for `whatsnew/3.12.rst` deprecations (#122093) 2024-07-24 02:29:35 -06:00
Jelle Zijlstra 7b7b90d1ce
gh-119180: Add `annotationlib` module to support PEP 649 (#119891)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-07-23 21:16:50 +00:00
Serhiy Storchaka e6b25e9a09
gh-122163: Add notes for JSON serialization errors (GH-122165)
This allows to identify the source of the error.
2024-07-23 20:02:54 +03:00
Ville Skyttä 498cb6dff1
Docs: Use cross-reference to `os.uname` in `sysconfig.get_platform` (#122083) 2024-07-23 14:08:39 +01:00
Adam Turner 53e9e7de63
GH-121970: Remove ``escape4chm`` (#122065) 2024-07-23 13:30:06 +01:00
Donghee Na a9bb3c7b3b
gh-121996: Introduce --disable-safety and --enable-slower-safety options (#122054)
* gh-121996: Introduce --disable-safty and --enable-slower-safty

* Update GA

* fix

* Address code review

* Update CI
2024-07-23 09:22:04 +09:00
Jelle Zijlstra 2762c6cc5e
gh-121637: Syntax error for optimized-away incorrect await (#121656)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 14:12:43 -07: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