question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Error when using post_mortem

See original GitHub issue

the code:

import pdbr
import sys
try:
    1/0
except Exception:
    pdbr.post_mortem(sys.exc_info()[2])

raises the error:

Traceback (most recent call last):
  File "D:/Program Data/Pycharm/PycharmProjects/python_tell/ttt.py", line 8, in <module>
    1/0
ZeroDivisionError: division by zero

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/Program Data/Pycharm/PycharmProjects/python_tell/ttt.py", line 10, in <module>
    pdbr.post_mortem(sys.exc_info()[2])
  File "D:\Program Data\Pycharm\PycharmProjects\python_tell\venv\lib\site-packages\pdbr\__main__.py", line 22, in post_mortem
    pdbr_cls().post_mortem(t)
  File "D:\Program Data\Pycharm\PycharmProjects\python_tell\venv\lib\site-packages\pdbr\utils.py", line 70, in pdbr_cls
    return klass()
  File "D:\Program Data\Pycharm\PycharmProjects\python_tell\venv\lib\site-packages\pdbr\_pdbr.py", line 55, in __init__
    super().__init__(**init_kwargs)
  File "D:\Program Data\Pycharm\PycharmProjects\python_tell\venv\lib\site-packages\IPython\terminal\debugger.py", line 32, in __init__
    self.pt_init(pt_session_options)
  File "D:\Program Data\Pycharm\PycharmProjects\python_tell\venv\lib\site-packages\IPython\terminal\debugger.py", line 74, in pt_init
    style=self.shell.style,
AttributeError: 'TerminalInteractiveShell' object has no attribute 'style'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
matan-hcommented, Mar 31, 2021

this works. note that without ipython installed it works also without your correction. Thank you

0reactions
cansarigolcommented, Mar 31, 2021

Could you try that suggestion in the below link? I wonder whether or not your error will be fixed. https://github.com/prompt-toolkit/python-prompt-toolkit/issues/406#issuecomment-483569596

Read more comments on GitHub >

github_iconTop Results From Across the Web

Coding error postmortem
The code in question used an overly complex indexing scheme (in particular, using a double negative [~ isnull()] rather than a more intuitive ......
Read more >
Postmortem culture: how you can learn from failure - re:Work
Failures are an inevitable part of innovation and can provide great data to make products, services, and organizations better.
Read more >
What is an Incident Postmortem? | Articles | PagerDuty
A postmortem (or post-mortem) is a process intended to help you learn from past incidents. It typically involves an analysis or discussion soon...
Read more >
Postmortem: An error autopsy. - LinkedIn
Everything started at 8:00 pm (CST) when the web server that we were using for our data analysis web app went down due...
Read more >
Postmortem file does not exist error when ... - IBM
A "Postmortem file does not exist" error occurs if the downloadPostmortem management API method is invoked on an appliance where Postmortem logs is...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found