View Issue Details

IDProjectCategoryView StatusLast Update
0002269FreeCADBugpublic2015-12-15 13:15
Reporterpkoning2 Assigned Towmayer  
PrioritynormalSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformMacOSMac OSOS Version10.10.5
Product Version0.15 
Fixed in Version0.16 
Summary0002269: Python error flashes by but can't be captured or viewed
DescriptionI have an intermittent problem in my (large) Python script, possibly related to the handling of object updates (from recalculate). The symptom I get is a Python exception traceback message.

Unfortunately it's hard to do something about it, because the message is formatted badly, truncated, and only appears for a few seconds, in red, at the very bottom of the FreeCAD window. If I click on that message line, it goes away. I can't find any menu option or command to show that message. Even if I manage to catch it when it appears, the information I need is generally past the right end of the window -- I only see the top 1.5 lines of the call stack which are not sufficient.

An exception that occurs during script execution is no problem: those appear in the Python console window, correctly formatted. But this case is different. It doesn't even show up in sys.exc_info().
Steps To ReproduceI can sometimes reproduce this by forcing an exception in the onChange handler, but it doesn't seem to display the message all the time. (I can save sys.exc_info() when I force that exception, and that part does happen consistently, but I don't necessarily see the message in the bottom line.)
TagsNo tags attached.
FreeCAD Information

Activities

wmayer

2015-09-18 21:58

administrator   ~0006430

> Python error flashes by but can't be captured or viewed
Wrong!!! Activate the output window and then you will get a well formatted stacktrace!

wmayer

2015-09-18 22:01

administrator   ~0006431

Additionally, when Python redirection is enabled all Python errors are saved into FreeCAD.log in FreeCAD's user directory when you start FreeCAD with the option '--write-log'

pkoning2

2015-09-18 23:57

reporter   ~0006432

By "output window" do you mean the Python console window? I have that open, and script backtraces show there, but not this one.

Thanks for the suggestion about --write-log. Does that work on the Mac, where normally FreeCAD is invoked via its icon?

wmayer

2015-09-19 08:27

administrator   ~0006433

> By "output window" do you mean the Python console window?
No. Go to View > Views > Output window. This is a non-interactive window that shows normal messages, warnings and errors. In order to get the Python errors you have to activate the redirection of Python's stdout and stderr (which I guess you already have). Btw, Python errors are only written to the Python console when you interact with it.

> Does that work on the Mac, where normally FreeCAD is invoked via its icon?
If I am right then the starter icon actually is a directory (FreeCAD.app) or so with all the files inside. If there is a way to set any command line options there then yes, it's possible.

pkoning2

2015-09-22 20:38

reporter  

Screen Shot 2015-09-22 at 4.36.51 PM.png (Attachment missing)

pkoning2

2015-09-22 20:38

reporter   ~0006445

There is no "Output window" option in the View menu on the Mac, see attached screenshot.

wmayer

2015-09-23 07:42

administrator   ~0006446

OK, my fault! It's called "Report view".

pkoning2

2015-09-25 18:04

reporter   ~0006451

Yes, that does the job. Thanks.

Issue History

Date Modified Username Field Change
2015-09-18 18:03 pkoning2 New Issue
2015-09-18 21:58 wmayer Note Added: 0006430
2015-09-18 21:58 wmayer Status new => feedback
2015-09-18 22:01 wmayer Note Added: 0006431
2015-09-18 23:57 pkoning2 Note Added: 0006432
2015-09-18 23:57 pkoning2 Status feedback => new
2015-09-19 08:27 wmayer Note Added: 0006433
2015-09-19 08:28 wmayer Status new => feedback
2015-09-22 20:38 pkoning2 File Added: Screen Shot 2015-09-22 at 4.36.51 PM.png
2015-09-22 20:38 pkoning2 Note Added: 0006445
2015-09-22 20:38 pkoning2 Status feedback => new
2015-09-23 07:42 wmayer Note Added: 0006446
2015-09-25 18:04 pkoning2 Note Added: 0006451
2015-09-25 20:20 wmayer Status new => closed
2015-09-25 20:20 wmayer Assigned To => wmayer
2015-09-25 20:20 wmayer Resolution open => no change required
2015-12-15 13:15 yorik Fixed in Version => 0.16