-
-
Notifications
You must be signed in to change notification settings - Fork 338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trio and PyCharm fighting over sys.excepthook #1553
Comments
Oh, I guess you also described an issue with PyCharm's excepthook! Maybe we should leave this open but rename/change the summary to narrow the scope. |
Yeah, can you give more details on the PyCharm issue? In PyCharm, what do you get if you do: print(repr(sys.excepthook))
print(repr(sys.__excepthook__)) ? |
I hope it helped. |
Huh. And what do you get from 'print(sys.excepthook is sys.__excepthook__)'?
…On Mon, May 25, 2020, 22:50 András Mózes ***@***.***> wrote:
<built-in function excepthook>
<built-in function excepthook>
Process finished with exit code 0
I hope it helped.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<#1553 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AAEU42BRFGTPG5BFTI3G7H3RTNKB3ANCNFSM4NJR55HA>
.
|
I made a big misstake :( import sys
import trio
print(repr(sys.excepthook))
print(repr(sys.__excepthook__))
and now (previously I didn't import |
I was able to reproduce this using PyCharm. You have to use PyCharm's "debug" feature, not the normal "run" command:
I think this is their excepthook. |
Yes it is true, in debug, always there is the warning. |
Well, adding special monkeypatches for each random library is obviously a terrible long-term approach. But in the short term, that looks like a pretty easy special monkeypatch to do. Something like: check for the PyCharm excepthook, and if it's found then monkeypatch the |
I have also noticed this warning in PyCharm but have so far ignored it 😬 |
same warning for WingPro8, just ignore it.
|
Closing this in favor of agronholm/exceptiongroup#23. |
The Apport error reporting mechanism of Ubuntu as well as PyCharm register custom
sys.excepthook
s. This causes the warning:and prevents uncaught multierrors from being printed properly.
I can reproduce this problem by simply running the following
test.pyt
:from within PyCharm or on any Ubuntu/Mint machine that has the
python3-apport
packet installed.A possible workaround is to run
sys.excepthook = sys.__excepthook__
before importing trio but then the functionality of Apport/PyCharm will probably break.Unfortunately there is no way to register multiple excepthooks in Python. However we might be able to "wrap" existing excepthooks instead of giving up in desparation?
The text was updated successfully, but these errors were encountered: