draft line fails with bad error message

Here's the place for discussion related to coding in FreeCAD, C++ or Python. Design, interfaces and structures.
Forum rules
Be nice to others! Respect the FreeCAD code of conduct!
Post Reply
User avatar
looo
Veteran
Posts: 3941
Joined: Mon Nov 11, 2013 5:29 pm

draft line fails with bad error message

Post by looo »

1. select wb draft
2. select line tool
3. draw line

Code: Select all

('[Draft.todo.commit] Unexpected error:', <class 'SyntaxError'>, 'in ', ['pl = FreeCAD.Placement()', 'pl.Rotation.Q = (0.0,0.0,0.0,1.0)', 'pl.Base = FreeCAD.Vector(-19.303424835205078, -9.815643310546875, 0.0)', 'points = [FreeCAD.Vector(-19.303424835205078, -9.815643310546875, 0.0),FreeCAD.Vector(-1.0, 4.0, 0.0)]', 'line = Draft.makeWire(points,placement=pl,closed=False,face=True,support=None)', 'Draft.autogroup(line)', 'FreeCAD.ActiveDocument.recompute()'])
I already said this somewhere else but here we should really not return a warning and hide the real error message. Hiding trace backs is terrible practice in my eyes. Maybe this issue is already fixed in the latest master.

OS: Ubuntu 18.04.3 LTS (ubuntu:GNOME/ubuntu)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17646 (Git)
Build type: Release
Branch: master
Hash: 641d946fa47573562026e042b1706759bd47611e
Python version: 3.7.3
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: German/Germany (de_DE)
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: draft line fails with bad error message

Post by Syres »

I'd never seen that error before so I tried with two builds and cannot reproduce it. Could this be a specific Python version issue as I cannot see any syntax error in your output, as if it's a false positive?
All I get is:

Code: Select all

Draft workbench activated
Pick first point
Pick next point
OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17513 (Git)
Build type: Release
Branch: master
Hash: 7c48ad754c6a35f6331f133b27294fdd458bf67d
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)

OS: Windows 7 SP 1 (6.1)
Word size of OS: 64-bit
Word size of FreeCAD: 64-bit
Version: 0.19.17651 (Git)
Build type: Release
Branch: master
Hash: 16c26cb3b1cd7209ea8efc8cb30b3b18fd80cf95
Python version: 3.6.8
Qt version: 5.12.1
Coin version: 4.0.0a
OCC version: 7.3.0
Locale: English/United Kingdom (en_GB)
Syres
Veteran
Posts: 2893
Joined: Thu Aug 09, 2018 11:14 am

Re: draft line fails with bad error message

Post by Syres »

I now realise that the error was fixed by https://github.com/FreeCAD/FreeCAD/commit/a66c8a3 and the original change wasn't present in my old build. I can now understand why you have raised this because the root cause is being 'hidden' (in this case the importSVG.py bug) making the triage process longer than normal.
vocx
Veteran
Posts: 5197
Joined: Thu Oct 18, 2018 9:18 pm

Re: draft line fails with bad error message

Post by vocx »

looo wrote: Thu Aug 15, 2019 6:26 am I already said this somewhere else but here we should really not return a warning and hide the real error message.
How do you propose we solve this issue? I am not aware of the error being intentionally hidden.
Syres wrote: Thu Aug 15, 2019 10:13 am ... I can now understand why you have raised this because the root cause is being 'hidden' (in this case the importSVG.py bug) making the triage process longer than normal.
I don't understand why it would show the error in this case. I mean, if looo is drawing a line, does the line operation need access to the importSVG module? I don't see why the error would be hidden in that case. With the defective code (which indeed has been corrected in the latest master), the error is clearly visible when importing importSVG, but I didn't test other cases.
Always add the important information to your posts if you need help. Also see Tutorials and Video tutorials.
To support the documentation effort, and code development, your donation is appreciated: liberapay.com/FreeCAD.
User avatar
yorik
Founder
Posts: 13640
Joined: Tue Feb 17, 2009 9:16 pm
Location: Brussels
Contact:

Re: draft line fails with bad error message

Post by yorik »

looo wrote: Thu Aug 15, 2019 6:26 am I already said this somewhere else but here we should really not return a warning and hide the real error message.
This is not so much by intent but because at some point it would make FeeCAD crash, I think..
But it's indeed very rare that such command fails nowadays, I think we could just simply remove the try/except wrap...
Post Reply