Noisy tracebacks?
See original GitHub issueThere has been a change in how tracebacks are shown when running scripts. Example:
Traceback (most recent call last):
File "/path/to/my/venv/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 2881, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-fdeb52d5be8d>", line 1, in <module>
f.something()
File "/path/to/some/file.py", line 68, in something
assert 1 is not None
AssertionError
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/my/venv/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 1821, in showtraceback
stb = value._render_traceback_()
AttributeError: 'AssertionError' object has no attribute '_render_traceback_'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/path/to/my/venv/lib/python3.5/site-packages/IPython/core/ultratb.py", line 1132, in get_records
return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset)
File "/path/to/my/venv/lib/python3.5/site-packages/IPython/core/ultratb.py", line 313, in wrapped
return f(*args, **kwargs)
File "/path/to/my/venv/lib/python3.5/site-packages/IPython/core/ultratb.py", line 358, in _fixed_getinnerframes
records = fix_frame_records_filenames(inspect.getinnerframes(etb, context))
File "/path/to/my/venv/lib/python3.5/inspect.py", line 1455, in getinnerframes
frameinfo = (tb.tb_frame,) + getframeinfo(tb, context)
File "/path/to/my/venv/lib/python3.5/inspect.py", line 1412, in getframeinfo
filename = getsourcefile(frame) or getfile(frame)
File "/path/to/my/venv/lib/python3.5/inspect.py", line 672, in getsourcefile
if getattr(getmodule(object, filename), '__loader__', None) is not None:
File "/path/to/my/venv/lib/python3.5/inspect.py", line 720, in getmodule
os.path.realpath(f)] = module.__name__
AttributeError: module has no attribute '__name__'
This is quite noisy especially since the later two exceptions have nothing to do with my script. Can IPython do something to quiet this down? To be clear, AssertionError
is not the problem. If I replace line 68 with 1/0
, then you get `AttributeError: ‘ZeroDivisionError’ object has no attribute ‘render_traceback’. So it seems like IPython is making some assumptions that no longer hold in Python 3?
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:22 (12 by maintainers)
Top Results From Across the Web
Creating Beautiful Tracebacks with Python's Exception ...
To achieve this we will learn how to implement and use custom Exception Hooks that will remove all the noise from tracebacks, make...
Read more >CSCve10857 - fib gpb encode library throws noisy ... - Cisco Bug
Symptom: Traceback is seen in logging from mpls_lsd about missing protocol information RP/0/RSP0/CPU0:Mar 27 19:06:59.864 UTC: ...
Read more >Understanding the Python Traceback
A traceback is a report containing the function calls made in your code at a specific point. Tracebacks are known by many names,...
Read more >Learning to Identify Website's Landing URLs via Noisy Web ...
In this paper, we propose Traceback, a tracing framework that provides such a comprehensive view. We build per-user and multi-user chains from ...
Read more >pretty-traceback 2022.1018 - PyPI
All of this makes it easier for you to see patterns and filter out the signal from the noise. This tabular format is...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
It looks like this may have been discussed on the Python mailing list too: https://mail.python.org/pipermail/python-list/2015-February/685695.html
They concluded it was a versioning issue, but I’m IPython 5.1.0 and I still have the issue.
The fix will be included in next release. Usually last friday of the month, but next week is holliday so well likely soon. Once 7.10 is released you’ll be able to just update with conda.