[Python-checkins] gh-89412: Add missing attributes (added in 3.10) to traceback module docs (#105046)

ambv webhook-mailer at python.org
Mon Jun 5 12:10:21 EDT 2023


https://github.com/python/cpython/commit/a4f72fa39a9d391c7b931ba1906d81da4ae01949
commit: a4f72fa39a9d391c7b931ba1906d81da4ae01949
branch: main
author: Jakub Kuczys <me at jacken.men>
committer: ambv <lukasz at langa.pl>
date: 2023-06-05T18:10:13+02:00
summary:

gh-89412: Add missing attributes (added in 3.10) to traceback module docs (#105046)

files:
A Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst
M Doc/library/traceback.rst
M Lib/traceback.py

diff --git a/Doc/library/traceback.rst b/Doc/library/traceback.rst
index 58f47818fcec..36171a3b5a61 100644
--- a/Doc/library/traceback.rst
+++ b/Doc/library/traceback.rst
@@ -279,6 +279,13 @@ capture data for later printing in a lightweight fashion.
 
       For syntax errors - the line number where the error occurred.
 
+   .. attribute:: end_lineno
+
+      For syntax errors - the end line number where the error occurred.
+      Can be ``None`` if not present.
+
+      .. versionadded:: 3.10
+
    .. attribute:: text
 
       For syntax errors - the text where the error occurred.
@@ -287,6 +294,13 @@ capture data for later printing in a lightweight fashion.
 
       For syntax errors - the offset into the text where the error occurred.
 
+   .. attribute:: end_offset
+
+      For syntax errors - the end offset into the text where the error occurred.
+      Can be ``None`` if not present.
+
+      .. versionadded:: 3.10
+
    .. attribute:: msg
 
       For syntax errors - the compiler error message.
diff --git a/Lib/traceback.py b/Lib/traceback.py
index 0ea77bfb9461..21e32040ee98 100644
--- a/Lib/traceback.py
+++ b/Lib/traceback.py
@@ -674,8 +674,8 @@ class TracebackException:
       occurred.
     - :attr:`offset` For syntax errors - the offset into the text where the
       error occurred.
-    - :attr:`end_offset` For syntax errors - the offset into the text where the
-      error occurred. Can be `None` if not present.
+    - :attr:`end_offset` For syntax errors - the end offset into the text where
+      the error occurred. Can be `None` if not present.
     - :attr:`msg` For syntax errors - the compiler error message.
     """
 
diff --git a/Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst b/Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst
new file mode 100644
index 000000000000..00937e58c985
--- /dev/null
+++ b/Misc/NEWS.d/next/Documentation/2023-05-28-19-08-42.gh-issue-89412.j4cg7K.rst
@@ -0,0 +1,2 @@
+Add missing documentation for the ``end_lineno`` and ``end_offset`` attributes
+of the :class:`traceback.TracebackException` class.



More information about the Python-checkins mailing list