-
-
Notifications
You must be signed in to change notification settings - Fork 32k
bpo-29660: traceback: Document that etype is ignored in some places. #344
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Doc/library/traceback.rst
Outdated
|
||
The optional *limit* argument has the same meaning as for :func:`print_tb`. | ||
If *chain* is true (the default), then chained exceptions (the | ||
:attr:`__cause__` or :attr:`__context__` attributes of the exception) will be | ||
printed as well, like the interpreter itself does when printing an unhandled | ||
exception. | ||
|
||
.. versionchanged:: 3.5 | ||
The *etype* argument is ignored and infered from the type of *value*. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
inferred (also repeated below)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed.
Doc/library/traceback.rst
Outdated
@@ -468,5 +474,5 @@ This last example demonstrates the final few formatting functions: | |||
[' File "spam.py", line 3, in <module>\n spam.eggs()\n', | |||
' File "eggs.py", line 42, in eggs\n return "bacon"\n'] | |||
>>> an_error = IndexError('tuple index out of range') | |||
>>> traceback.format_exception_only(type(an_error), an_error) | |||
>>> traceback.format_exception_only("ignored parameter", an_error) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does not seem to be the case for “format_exception_only”
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
indeed, fixed.
Doc/library/traceback.rst
Outdated
@@ -372,7 +378,7 @@ exception and traceback: | |||
print("*** print_tb:") | |||
traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) | |||
print("*** print_exception:") | |||
traceback.print_exception(exc_type, exc_value, exc_traceback, | |||
traceback.print_exception("ignored parameter", exc_value, exc_traceback, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not seem ideal. It is less compatible with older Python versions. If it needs clarifying at all, perhaps a comment would be better?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, sure.
1069939
to
b4727b6
Compare
Thanks, sorry for the delay to fix. Comments should be addressed. |
Doc/library/traceback.rst
Outdated
@@ -372,6 +378,7 @@ exception and traceback: | |||
print("*** print_tb:") | |||
traceback.print_tb(exc_traceback, limit=1, file=sys.stdout) | |||
print("*** print_exception:") | |||
# exc_type below ignored on 3.5 and later |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is ignored on 3.5 and later
The same for below :)
Thanks @Carreau 🎉 |
…aces. (pythonGH-344) (cherry picked from commit cdb89cd)
…aces. (pythonGH-344) (cherry picked from commit cdb89cd)
See http://bugs.python.org/issue29660