Skip to content

Commit 89bc380

Browse files
authored
Merge branch 'main' into pythongh-73435-pathlib-match-recursive
2 parents fec7702 + d593074 commit 89bc380

File tree

6 files changed

+33
-3
lines changed

6 files changed

+33
-3
lines changed

Doc/library/traceback.rst

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ The module also defines the following classes:
218218
:class:`TracebackException` objects are created from actual exceptions to
219219
capture data for later printing in a lightweight fashion.
220220

221-
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False)
221+
.. class:: TracebackException(exc_type, exc_value, exc_traceback, *, limit=None, lookup_lines=True, capture_locals=False, compact=False, max_group_width=15, max_group_depth=10)
222222

223223
Capture an exception for later rendering. *limit*, *lookup_lines* and
224224
*capture_locals* are as for the :class:`StackSummary` class.
@@ -230,6 +230,12 @@ capture data for later printing in a lightweight fashion.
230230

231231
Note that when locals are captured, they are also shown in the traceback.
232232

233+
*max_group_width* and *max_group_depth* control the formatting of exception
234+
groups (see :exc:`BaseExceptionGroup`). The depth refers to the nesting
235+
level of the group, and the width refers to the size of a single exception
236+
group's exceptions array. The formatted output is truncated when either
237+
limit is exceeded.
238+
233239
.. attribute:: __cause__
234240

235241
A :class:`TracebackException` of the original ``__cause__``.
@@ -238,6 +244,14 @@ capture data for later printing in a lightweight fashion.
238244

239245
A :class:`TracebackException` of the original ``__context__``.
240246

247+
.. attribute:: exceptions
248+
249+
If ``self`` represents an :exc:`ExceptionGroup`, this field holds a list of
250+
:class:`TracebackException` instances representing the nested exceptions.
251+
Otherwise it is ``None``.
252+
253+
.. versionadded:: 3.11
254+
241255
.. attribute:: __suppress_context__
242256

243257
The ``__suppress_context__`` value from the original exception.
@@ -323,6 +337,9 @@ capture data for later printing in a lightweight fashion.
323337
.. versionchanged:: 3.10
324338
Added the *compact* parameter.
325339

340+
.. versionchanged:: 3.11
341+
Added the *max_group_width* and *max_group_depth* parameters.
342+
326343

327344
:class:`StackSummary` Objects
328345
-----------------------------

Lib/pathlib.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -271,7 +271,7 @@ def __repr__(self):
271271
return "<{}.parents>".format(type(self._path).__name__)
272272

273273

274-
class PurePath(os.PathLike):
274+
class PurePath:
275275
"""Base class for manipulating paths without I/O.
276276
277277
PurePath represents a filesystem path and offers operations which
@@ -760,6 +760,10 @@ def match(self, path_pattern, *, case_sensitive=None):
760760
raise ValueError("empty pattern")
761761

762762

763+
# Subclassing os.PathLike makes isinstance() checks slower,
764+
# which in turn makes Path construction slower. Register instead!
765+
os.PathLike.register(PurePath)
766+
763767

764768
class PurePosixPath(PurePath):
765769
"""PurePath subclass for non-Windows systems.

Lib/traceback.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -658,6 +658,8 @@ class TracebackException:
658658
659659
- :attr:`__cause__` A TracebackException of the original *__cause__*.
660660
- :attr:`__context__` A TracebackException of the original *__context__*.
661+
- :attr:`exceptions` For exception groups - a list of TracebackException
662+
instances for the nested *exceptions*. ``None`` for other exceptions.
661663
- :attr:`__suppress_context__` The *__suppress_context__* value from the
662664
original exception.
663665
- :attr:`stack` A `StackSummary` representing the traceback.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Add missing documentation for the ``max_group_depth`` and ``max_group_width``
2+
parameters and the ``exceptions`` attribute of the
3+
:class:`traceback.TracebackException` class.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
When installed from the Microsoft Store, ``pip`` no longer defaults to
2+
per-user installs. However, as the install directory is unwritable, it
3+
should automatically decide to do a per-user install anyway. This should
4+
resolve issues when ``pip`` is passed an option that conflicts with
5+
``--user``.

PC/layout/support/options.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ def public(f):
4141
"options": [
4242
"stable",
4343
"pip",
44-
"pip-user",
4544
"tcltk",
4645
"idle",
4746
"venv",

0 commit comments

Comments
 (0)