Describe the bug:
When using the option use_elastic_excepthook every uncaught exception also produces the following TypeError:
Error in sys.excepthook:
TypeError: _excepthook() takes 1 positional argument but 4 were given
To Reproduce
Run the following Python snippet
import elasticapm
def run():
raise Exception("hello")
client = elasticapm.Client(
{"SERVICE_NAME": "test"},
use_elastic_excepthook=True,
)
run()
It will produce this output:
Error in sys.excepthook:
TypeError: _excepthook() takes 1 positional argument but 4 were given
Original exception was:
Traceback (most recent call last):
File "t.py", line 13, in <module>
run()
File "t.py", line 5, in run
raise Exception("hello")
Exception: hello
Environment (please complete the following information)
- OS: MacOS 10.15.3
- Python version: 3.8.5
- Agent version: 6.0.0
Additional context
The problem seems to be with the function signature of the Client._excepthook function that is used to override the sys.excepthook.
The sys.excepthook expects three arguments (type, value, traceback), while the Client._excepthook only expects the self argument.
Describe the bug:
When using the option use_elastic_excepthook every uncaught exception also produces the following
TypeError:To Reproduce
Run the following Python snippet
It will produce this output:
Environment (please complete the following information)
Additional context
The problem seems to be with the function signature of the Client._excepthook function that is used to override the
sys.excepthook.The sys.excepthook expects three arguments (type, value, traceback), while the
Client._excepthookonly expects theselfargument.