Commit graph

125635 commits

Author SHA1 Message Date
Yan Yanchii
30268b5d2f
gh-128377: Skip test_cmd_line.test_non_interactive_output_buffering when PYTHONUNBUFFERED=1 (#128378)
The `test_cmd_line.test_non_interactive_output_buffering` test assumes a buffered `stdio`
without checking the `PYTHONUNBUFFERED` value. Instead of changing the environment
variable for the duration of the test, it is better to simply skip it.
2025-01-12 09:27:28 +01:00
Barney Gale
22a442181d
GH-128520: Divide pathlib ABCs into three classes (#128523)
In the private pathlib ABCs, rename `PurePathBase` to `JoinablePath`, and
split `PathBase` into `ReadablePath` and `WritablePath`. This improves the
API fit for read-only virtual filesystems.

The split of `PathBase` entails a similar split of `CopyWorker` (implements
copying) and the test cases in `test_pathlib_abc`.

In a later patch, we'll make `WritablePath` inherit directly from
`JoinablePath` rather than `ReadablePath`. For a couple of reasons,
this isn't quite possible yet.
2025-01-11 19:27:47 +00:00
Yan Yanchii
0946ed25b5
gh-128438: Add EnvironmentVarGuard for test_pdb.py (#128522) 2025-01-11 11:19:29 -05:00
9cel
3a570c6d58
Make the Python CLI error message style more consistent (GH-128129) 2025-01-11 11:17:35 +02:00
RUANG (James Roy)
553cdc6d68
gh-128696: Add arm64 to the get_platform return val description (#128701) 2025-01-11 01:03:12 +00:00
Adam Johnson
1b39b502d3
gh-128409: Document that pdb.post_mortem() accepts exceptions (#128410)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-01-10 10:54:45 -05:00
Petr Viktorin
802556abfa
gh-127257: Add hex code to ssl "unknown error" message (GH-127360)
* ssl: Add hex error code to "unknown error" messages

To make it easier to vary the individual parts of the message,
replace the if-ladder with constant format strings by building
the string piece-wise with PyUnicodeWriter.

Use "unknown error (0x%x)" rather than just "unknown error" if we
can't get a better error message. (Hex makes sense as the error
includes two packed parts.)
2025-01-10 13:59:51 +01:00
Paulie Peña
688f3a0d4b
gh-128388: pyrepl on Windows: add meta and ctrl+arrow keybindings (GH-128389)
Fix `Lib/_pyrepl/windows_console.py` to support more keybindings, like the
`Ctrl`+`←` and `Ctrl`+`→` word-skipping keybindings and those with meta (i.e. Alt),
e.g. to `kill-word` or `backward-kill-word`.

Specifics: if Ctrl is pressed, emit "ctrl left" and "ctrl right" instead of just "left" or
"right," and if Meta/Alt is pressed, emit the special key code for meta before
emitting the other key that was pressed.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
2025-01-10 13:52:19 +01:00
Bénédikt Tran
baf65715fc
gh-111178: fix UBSan failures for gdbmobject (GH-128178)
* fix UBSan failures for `gdbmobject`
* suppress unused return values
2025-01-10 11:52:36 +01:00
Bénédikt Tran
28ffdc5702
gh-111178: fix UBSan failures in Python/bltinmodule.c (GH-128235)
* fix UBSan failures for `filterobject`
* fix UBSan failures for `mapobject`
* fix UBSan failures for `zipobject`
2025-01-10 11:51:24 +01:00
Bénédikt Tran
613240bf03
gh-111178: fix UBSan failures in Objects/bytearrayobject.c (GH-128236)
* fix UBSan failures for `bytesiterobject`
* fix UBSan failures for `PyByteArrayObject`
2025-01-10 11:50:02 +01:00
Bénédikt Tran
295776c7f3
gh-111178: fix UBSan failures in Objects/bytesobject.c (GH-128237)
* remove redundant casts for `bytesobject`
* fix UBSan failures for `striterobject`
2025-01-10 11:48:06 +01:00
Bénédikt Tran
49d78158c0
gh-111178: fix UBSan failures in Modules/_bz2module.c (GH-128238) 2025-01-10 11:47:19 +01:00
Bénédikt Tran
6cf31750e0
gh-111178: fix UBSan failures in Objects/complexobject.c (GH-128241)
fix UBSan failures for `PyComplexObject`
2025-01-10 10:46:36 +00:00
sobolevn
65b484db97
gh-128694: Fix (env changed) error in test_inspect (#128702) 2025-01-10 13:25:02 +03:00
Bénédikt Tran
2fcdc8488c
gh-126862: Use Py_ssize_t instead of int when processing the number of super-classes (#127523) 2025-01-10 03:32:53 +00:00
Sam Gross
c1417487e9
gh-128691: Use deferred reference counting on _thread._local (#128693)
This change, along with the LOAD_ATTR specializations, makes the
"thread_local_read" micro benchmark in Tools/ftscalingbench/ftscalingbench.py
scale well to multiple threads.
2025-01-10 00:59:10 +00:00
sobolevn
087bb48aca
gh-127196: Fix crash in _interpreters, when shared had invalid encodings (#127220) 2025-01-09 19:45:35 +00:00
dgpb
8af5781094
gh-128650: Fix incorrect statement in partial documentation (gh-128651) 2025-01-09 13:32:00 -06:00
Kumar Aditya
7dc41ad6a7
gh-128002: fix asyncio.all_tasks against concurrent deallocations of tasks (#128541) 2025-01-09 21:26:00 +05:30
sobolevn
b725297cee
gh-128661: Fix typing.evaluate_forward_ref not showing deprecation (#128663)
gh-128661: Fix `typing.evaluate_forward_ref` not showing deprecataion
2025-01-09 18:15:13 +03:00
sobolevn
43ac9f5059
gh-128673: Increase coverage of typing.get_type_hints (#128674) 2025-01-09 17:25:03 +03:00
Peter Bierma
ea39c8b08d
gh-118915: Document PyUnstable_InterpreterState_GetMainModule (GH-128483) 2025-01-09 14:54:44 +01:00
Kumar Aditya
4322a318ea
gh-124433: fix docs for asyncio.Queue.task_done (#128669) 2025-01-09 17:50:12 +05:30
Kumar Aditya
b2adf55674
gh-126137: improve docs for loop.add_reader and loop.add_writer (#128666) 2025-01-09 15:40:45 +05:30
Petr Viktorin
1439b81928
gh-128629: Add Py_PACK_VERSION and Py_PACK_FULL_VERSION (GH-128630) 2025-01-09 11:10:28 +01:00
Kumar Aditya
4685401845
gh-79149: document reentrant safety of loop.call_soon_threadsafe (#128662)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2025-01-09 09:19:05 +00:00
Tomas R.
a1284e9797
gh-97850: Remove the mention of removal from ResourceReader docs (#128602)
Remove the mention of removal from ResourceReader docs
2025-01-08 18:38:02 -05:00
Filipe Laíns 🇵🇸
58a9133fc2
acks: add myself (#128652) 2025-01-08 21:10:43 +00:00
Filipe Laíns 🇵🇸
34e840f9dd
GH-66409: check if exec_prefix is the same as prefix before searching executable_dir (#127974) 2025-01-08 20:23:16 +00:00
Brandt Bucher
004f9fd1f2
Remove unnecessary LIST_TO_TUPLE conversions (GH-126558) 2025-01-08 09:00:11 -08:00
Bénédikt Tran
845d924efb
gh-111178: fix UBSan failures in Objects/capsule.c (GH-128239)
fix UBSan failures for `PyCapsule`
2025-01-08 14:55:04 +01:00
Bénédikt Tran
1da0901894
gh-111178: fix UBSan failures in Python/context.c (GH-128242)
* fix UBSan failures for `PyContext`
* fix UBSan failures for `PyContextVar`
* fix UBSan failures for `PyContextToken`
* fix UBSan failures for `_PyContextTokenMissing`
2025-01-08 14:52:27 +01:00
Bénédikt Tran
c22302ecea
gh-111178: fix UBSan failures in Python/hamt.c (GH-128247)
* fix UBSan failures for `PyHamtObject`
* fix UBSan failures for `PyHamtNode_Array`
* fix UBSan failures for `PyHamtNode_Collision`
* fix UBSan failures for `PyHamtNode_Bitmap`
2025-01-08 14:50:40 +01:00
sobolevn
74a517181a
gh-128615: Cover pickling of ParamSpecArgs and ParamSpecKwargs (#128616) 2025-01-08 15:04:54 +03:00
Filipe Laíns 🇵🇸
95cd9c669c
GH-127970: find the runtime library when dladdr is available (#127972) 2025-01-08 12:03:21 +00:00
sobolevn
eb26e17069
gh-128613: Increase typing.Concatenate coverage (#128614) 2025-01-08 15:02:47 +03:00
sobolevn
971a52b549
gh-128617: Fix test_typing.test_readonly_inheritance (#128618) 2025-01-08 14:19:41 +03:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
474e419792
gh-41872: Fix quick extraction of module docstrings from a file in pydoc (GH-127520)
It now supports docstrings with single quotes, escape sequences,
raw string literals, and other Python syntax.

Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-01-08 10:32:07 +00:00
Erlend E. Aasland
cdfb8bc93a
gh-87506: Amend json.loads() post PR #127355 (#128609) 2025-01-08 09:36:44 +01:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
15372d0112
gh-87506: Document that json.load*() can raise UnicodeDecodeError (#127355)
Co-authored-by: Erlend Aasland <erlend@python.org>
2025-01-08 07:35:43 +00:00
Brandt Bucher
65ae3d5a73
GH-127809: Fix the JIT's understanding of ** (GH-127844) 2025-01-07 17:25:48 -08:00
Erlend E. Aasland
e08b28235a
gh-127614: Correctly check for ttyname_r() in configure (#128503)
PR #14868 replaced the ttyname() call with ttyname_r(), but the old
check remained.
2025-01-07 22:42:36 +01:00
Serhiy Storchaka
07e6aa2efc
gh-127350: Add more tests for Py_fopen() (GH-128587) 2025-01-07 21:13:08 +00:00
Erlend E. Aasland
a21e31ec54
Docs: mark up json.load() using parameter list (#128488) 2025-01-07 22:07:17 +01:00
T. Wouters
8f93dd8a8f
gh-115999: Add free-threaded specialization for COMPARE_OP (#126410)
Add free-threaded specialization for COMPARE_OP, and tests for COMPARE_OP specialization in general.

Co-authored-by: Donghee Na <donghee.na92@gmail.com>
2025-01-07 06:41:01 -08:00
Bénédikt Tran
a734c1e304
gh-111178: fix UBSan failures in Modules/_sre/sre.c (GH-128250)
fix UBSan failures for `PatternObject`, `MatchObject`, `TemplateObject`, `ScannerObject`
2025-01-07 12:47:18 +01:00
Bénédikt Tran
bcdf654c8a
gh-111178: fix UBSan failures in Modules/_abc.c (GH-128253)
* fix UBSan failures in `_abc.c`
* suppress unused return values
2025-01-07 12:45:29 +01:00
Thomas Grainger
61b9811ac6
gh-128552: fix refcycles in eager task creation (#128553) 2025-01-07 11:44:57 +00:00
Stephen Morton
6ea04da270
gh-128302: Fix bugs in xml.dom.xmlbuilder (GH-128284)
* Allow DOMParser.parse() to correctly handle DOMInputSource instances
  that only have a systemId attribute set.
* Fix DOMEntityResolver.resolveEntity(), which was broken by the
  Python 3.0 transition.
* Add Lib/test/test_xml_dom_xmlbuilder.py with few tests.
2025-01-07 12:40:41 +02:00