Skip to content
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

Disable IPython bug message #12139

Open
tom-doerr opened this issue Feb 23, 2020 · 12 comments
Open

Disable IPython bug message #12139

tom-doerr opened this issue Feb 23, 2020 · 12 comments

Comments

@tom-doerr
Copy link

Is there a way to suppress this message?

If you suspect this is an IPython bug, please report it at:
    https://github.com/ipython/ipython/issues
or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug"
to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via:
    %config Application.verbose_crash=True

I never encountered an IPython bug and probably will not encounter one in the future.

@tom-doerr
Copy link
Author

Maybe it makes sense to remove those messages from IPython and instead add them to the issue template.
Example of an issue template: https://github.com/GothenburgBitFactory/taskwarrior/issues/new

@Carreau
Copy link
Member

Carreau commented Feb 25, 2020

We do actually have bug reports that are genuine crash in IPython. We might be able to have a flag that deactivate this. What behavior would you expect ? Just no messages ?

@tom-doerr
Copy link
Author

Yes, I would expect no messages.
They make it harder to find the error and, depending on the terminal size, completely hide the traceback.

@PhanatosZou
Copy link
Contributor

Hi, I'm new here. If there's any thing need to be fixed, I'd love to help out!

@mtrazzi
Copy link

mtrazzi commented Mar 29, 2020

when running "interact" on ipdb (import ipdb; ipdb.set_trace()) i get the same error message, would be great to know how to disable it

@valyagolev
Copy link

for some reason, python .\manage.py makemigrations shows this on any kind of problem. i wish there was a way to make this go away

@diazdc
Copy link

diazdc commented Oct 31, 2020

Any update on this? I use interact mode in ipdb on a daily basis for work and it would be nice to see the actual python errors at the bottom of my console instead of the "if you suspect.." message. I appreciate your efforts.

@LuanComputacao
Copy link

This errors is just an annoying thing.
There is no consistent explanations about what needs to be done over the message.
Because of this I just suggested to my 120 trainees to avoid to install ipython before a good fix or enhancement of this strange feature.

@cristianbarreto17
Copy link

Any update please?

@Carreau
Copy link
Member

Carreau commented Jan 14, 2021

Thanks for the ping, unfortunately this is an open-source project on which I work for free, and I already do not have enough time to keep track of existing PRs and issue.

If you encounter this error message it is likely a real unexpected code path in IPython; so please list your complete error message or how you triggered it.

If you really want to get rid of it and are annoyed; The code that set the excepthook is likely in IPython/core/application.py line 256:

    def excepthook(self, etype, evalue, tb):
        """this is sys.excepthook after init_crashhandler
        
        set self.verbose_crash=True to use our full crashhandler, instead of
        a regular traceback with a short message (crash_handler_lite)
        """
        
        if self.verbose_crash:
            return self.crash_handler(etype, evalue, tb)
        else:
            return crashhandler.crash_handler_lite(etype, evalue, tb)

and Line 247:

    def init_crash_handler(self):
        """Create a crash handler, typically setting sys.excepthook to it."""
        return
        self.crash_handler = self.crash_handler_class(self)
        sys.excepthook = self.excepthook
        def unset_crashhandler():
            sys.excepthook = sys.__excepthook__
        atexit.register(unset_crashhandler)

Line 214 is how to add a configuration flag example:

   verbose_crash = Bool(False,
        help="""Create a massive crash report when IPython encounters what may be an
        internal error.  The default is to append a short message to the
        usual traceback""").tag(config=True)

You are welcome to open a PR.

@Twallace51
Copy link

Solution is simply disabling last line in
/usr/lib/python3/dist-packages/IPython/core/crashhandler.py

#print(_lite_message_template.format(email=author_email, config=config, version=version), file=sys.stderr)

@MrMino
Copy link
Member

MrMino commented Mar 25, 2021

@Twallace51 thanks for finding it, it surely helps. But I think that, rather than disabling it completely, it should be configurable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants