[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: The python-ideas list is where ideas for enhancements and improvements are discussed. I suggest you bring this up there. https://mail.python.org/mailman3/lists/python-ideas.python.org/ -- ___ Python tracker

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: Neither of those things preclude the possibility of the traceback module doing a better job of printing tracebacks for exceptions where __traceback__ = None. -- ___ Python tracker

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: I'm going to close this issue because it's not a bug. I understand your question now, as well as the source of your confusion: you thought that traceback is "the thing that is printed to the screen when an exception is raised" and that __traceback__ is

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: __traceback__ doesn't disable printing tracebacks. It *is* the traceback. By setting it to None you erased the exception's traceback. -- ___ Python tracker

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: I don't think it's helpful to make such a literalistic interpretation. Just because the variable is called "traceback" doesn't mean it should apply only to the things that are *technically* a traceback (and I don't agree anyway that the line containing the

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: The traceback is only one part of an exception. It is simply a list of frames that show where the exception travelled between being raised and being caught. An exception contains information about an error, including the type of the exception, sometimes some

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: I think I found another way to achieve what I was trying to do, which is why I never pursued this. But I still think it's a bug. __traceback__ = None isn't documented anywhere that I could find, so I was only able to deduce how it should work from reading the

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Change by Irit Katriel : -- status: open -> pending ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: I had no intention to insult you and apologize if I did. I assumed that you forgot about this issue since you didn't chase it for 3 years, but you are right that I should have asked. I am reopening it so that you can explain the question. Since you didn't

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Aaron Meurer
Aaron Meurer added the comment: > It's not entirely clear to me what you are trying to do (what is the output > you are hoping to get?) but this looks more like a question than a bug > report, so I am closing this issue. If this is still relevant, I'd suggest > you ask on the python users

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2020-11-04 Thread Irit Katriel
Irit Katriel added the comment: Setting __traceback__ to None is not going to make the exception disappear. Note that TracebackException does not represent a traceback, it represent an exception (for rendering in tracebacks). So all information of the exception is rendered by

[issue30384] traceback.TracebackException.format shouldn't format_exc_only() when __traceback__ is None

2017-05-16 Thread Aaron Meurer
New submission from Aaron Meurer: I'm trying to completely hide an exception from the traceback module. From reading the source, it looks like the only way to do this is to set __traceback__ to None (I can also set __suppress_context__ to True, but that only works if I have another exception