@@ -170,7 +170,9 @@ PEP 768: Safe external debugger interface for CPython
170
170
171
171
:pep: `768 ` introduces a zero-overhead debugging interface that allows debuggers and profilers
172
172
to safely attach to running Python processes. This is a significant enhancement to Python's
173
- debugging capabilities allowing debuggers to forego unsafe alternatives.
173
+ debugging capabilities allowing debuggers to forego unsafe alternatives. See
174
+ :ref: `below <whatsnew314-remote-pdb >` for how this feature is leveraged to
175
+ implement the new :mod: `pdb ` module's remote attaching capabilities.
174
176
175
177
The new interface provides safe execution points for attaching debugger code without modifying
176
178
the interpreter's normal execution path or adding runtime overhead. This enables tools to
@@ -220,6 +222,32 @@ See :pep:`768` for more details.
220
222
221
223
(Contributed by Pablo Galindo Salgado, Matt Wozniski, and Ivona Stojanovic in :gh: `131591 `.)
222
224
225
+
226
+ .. _whatsnew314-remote-pdb :
227
+
228
+ Remote attaching to a running Python process with PDB
229
+ -----------------------------------------------------
230
+
231
+ The :mod: `pdb ` module now supports remote attaching to a running Python process
232
+ using a new ``-p PID `` command-line option:
233
+
234
+ .. code-block :: sh
235
+
236
+ python -m pdb -p 1234
237
+
238
+ This will connect to the Python process with the given PID and allow you to
239
+ debug it interactively. Notice that due to how the Python interpreter works
240
+ attaching to a remote process that is blocked in a system call or waiting for
241
+ I/O will only work once the next bytecode instruction is executed or when the
242
+ process receives a signal.
243
+
244
+ This feature leverages :pep: `768 ` and the :func: `sys.remote_exec ` function
245
+ to attach to the remote process and send the PDB commands to it.
246
+
247
+
248
+ (Contributed by Matt Wozniski and Pablo Galindo in :gh: `131591 `.)
249
+
250
+
223
251
.. _whatsnew314-pep758 :
224
252
225
253
PEP 758 – Allow except and except* expressions without parentheses
@@ -391,6 +419,21 @@ Improved error messages
391
419
^^^^^^^
392
420
ValueError : too many values to unpack (expected 3 , got 4 )
393
421
422
+ * :keyword: `elif ` statements that follow an :keyword: `else ` block now have a specific error message.
423
+ (Contributed by Steele Farnsworth in :gh: `129902 `.)
424
+
425
+ .. code-block :: pycon
426
+
427
+ >>> if who == "me":
428
+ ... print("It's me!")
429
+ ... else:
430
+ ... print("It's not me!")
431
+ ... elif who is None:
432
+ ... print("Who is it?")
433
+ File "<stdin>", line 5
434
+ elif who is None:
435
+ ^^^^
436
+ SyntaxError: 'elif' block follows an 'else' block
394
437
395
438
* If a statement (:keyword: `pass `, :keyword: `del `, :keyword: `return `,
396
439
:keyword: `yield `, :keyword: `raise `, :keyword: `break `, :keyword: `continue `,
@@ -1274,6 +1317,9 @@ sys
1274
1317
* On FreeBSD, :data: `sys.platform ` doesn't contain the major version anymore.
1275
1318
It is always ``'freebsd' ``, instead of ``'freebsd13' `` or ``'freebsd14' ``.
1276
1319
1320
+ * Raise :exc: `DeprecationWarning ` for :func: `sys._clear_type_cache `. This
1321
+ function was deprecated in Python 3.13 but it didn't raise a runtime warning.
1322
+
1277
1323
1278
1324
sys.monitoring
1279
1325
--------------
@@ -1449,6 +1495,17 @@ uuid
1449
1495
(Contributed by Simon Legner in :gh: `131236 `.)
1450
1496
1451
1497
1498
+ webbrowser
1499
+ ----------
1500
+
1501
+ * Names in the :envvar: `BROWSER ` environment variable can now refer to already
1502
+ registered browsers for the :mod: `webbrowser ` module, instead of always
1503
+ generating a new browser command.
1504
+
1505
+ This makes it possible to set :envvar: `BROWSER ` to the value of one of the
1506
+ supported browsers on macOS.
1507
+
1508
+
1452
1509
zipinfo
1453
1510
-------
1454
1511
0 commit comments