traceback.print_exc() shows stacktrace of cython layer, but traceback.print_stack() does not
See original GitHub issueprint_exc()
hello.pyx
import traceback
try:
raise
except:
traceback.print_exc()
=>
Traceback (most recent call last):
File "hello.pyx", line 4, in hello (hello.c:1050)
raise
print_stack()
hello.pyx
import traceback
traceback.print_stack()
=>
File "/home/sonots/.pyenv/versions/3.6.1/lib/python3.6/traceback.py", line 186, in print_stack
print_list(extract_stack(f, limit=limit), file=file)
This does not show File "hello.pyx", line 4, in hello (hello.c:1050)
Issue Analytics
- State:
- Created 6 years ago
- Comments:22 (11 by maintainers)
Top Results From Across the Web
traceback — Print or retrieve a stack traceback — Python 3.11 ...
Print exception information and stack trace entries from traceback object tb to file. This differs from print_tb() in the following ways: if tb...
Read more >How to catch and print the full exception traceback without ...
This doesn't work in Python 3 and needs to be changed to desired_trace = traceback.format_exc() . Passing sys.exc_info() as the argument was never...
Read more >Print or retrieve a stack traceback — Python 2.7.2 documentation
Print up to limit stack trace entries from traceback. ... This differs from print_tb() in the following ways: (1) if traceback is not...
Read more >Print or retrieve a stack traceback — Python 3.4.2 documentation
Print exception information and up to limit stack trace entries from traceback to file. This differs from print_tb() in the following ways: if...
Read more >Python: print stack trace after catching exception - Code Maven
examples/python/stack_trace.py. import traceback; def g():; f(); def f():; raise Exception("hi"); try: g(); except Exception as e: ...
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 FreeTop 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
Top GitHub Comments
Trackebacks are added as the exception propagates upwards; for debugging you could simply raise an exception to see where you are.
Is what I tested there useful? Just making sure I actually tried the right thing regarding
Stack traces might also "just work" when profiling is enabled
hoping it helps establishing whether a new option would make sense or not