Forum Archive

Pythonista crash log?

shinyformica

Having just gone through the annoyingly difficult process of debugging a crash happening somewhere in my code, but not directly caused by python (not a traceback...something I'm doing in objc or elsewhere), I wonder:

Does pythonista record anything to a log when it crashes running python code? Is there some way to generate or examine such a log?

I swear I read a post on here at one point a while back which mentioned something about crash logs...but I can't find it by searching for that phrase.

cvp

@shinyformica Put this
as pythonista_startup.py, restart Pythonista after your crash and you'll find a faultlog with the reason of an objectivec crash.

dgelessus

If I remember correctly, the enable_faulthandler.py can't be used as a pythonista_startup.py directly (by default the faulthandler script is meant to be importable, so it doesn't run when loaded). This gist contains the faulthandler script as a working pythonista_startup.py. (The faulthandler prints a message in the console when it runs, so you can tell when it's working correctly.)