Skip to content

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

Merged
merged 2 commits into from
Jun 1, 2017

Conversation

Carreau
Copy link
Contributor

@Carreau Carreau commented Feb 27, 2017


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*.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

inferred (also repeated below)

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed.

@@ -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)
Copy link
Member

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”

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

indeed, fixed.

@@ -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,
Copy link
Member

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?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, sure.

@vstinner vstinner changed the title bpo-29660: Document that etype is ignored in some places. bpo-29660: traceback: Document that etype is ignored in some places. Mar 2, 2017
@vstinner vstinner added the docs Documentation in the Doc dir label Mar 2, 2017
@Carreau Carreau force-pushed the doccument-deprecated-etype branch from 1069939 to b4727b6 Compare March 2, 2017 22:52
@Carreau
Copy link
Contributor Author

Carreau commented Mar 2, 2017

Thanks, sorry for the delay to fix. Comments should be addressed.

@@ -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
Copy link
Member

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 :)

@Mariatta Mariatta merged commit cdb89cd into python:master Jun 1, 2017
@Mariatta
Copy link
Member

Mariatta commented Jun 1, 2017

Thanks @Carreau 🎉

@Carreau Carreau deleted the doccument-deprecated-etype branch June 2, 2017 03:01
@Carreau Carreau restored the doccument-deprecated-etype branch June 2, 2017 03:01
Carreau added a commit to Carreau/cpython that referenced this pull request Jun 2, 2017
Carreau added a commit to Carreau/cpython that referenced this pull request Jun 2, 2017
Mariatta pushed a commit that referenced this pull request Jun 2, 2017
Mariatta pushed a commit that referenced this pull request Jun 2, 2017
@Carreau Carreau deleted the doccument-deprecated-etype branch June 2, 2017 03:39
akruis pushed a commit to stackless-dev/stackless that referenced this pull request Nov 1, 2017
akruis pushed a commit to stackless-dev/stackless that referenced this pull request Nov 1, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
docs Documentation in the Doc dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants