0.92.5 Path to Gcode (gcodetools) not working with python3
Steps to reproduce:
- get distro inkscape 0.92.4
- due to inkscape not respecting the python interpreter specified in the first line of the py file, the standard py2 scripts fail on fedora, where python defaults to py3.
- install python3 ready scripts for 0.92.5:
https://gitlab.com/inkscape/inkscape/blob/0.92.x/share/extensions
- open Inkscape
- open svg file, e.g. https://gitlab.com/inkscape/inbox/uploads/bac08a3fc8cd2c64d7e778809d630ccc/inkscape-gcodetoolstest-circle.svg
- apply path to gcode extension (without any selection)
What happened?
Traceback (most recent call last):
File "gcodetools.py", line 6751, in <module>
gcodetools.affect()
File "/usr/share/inkscape/extensions/inkex.py", line 289, in affect
self.effect()
File "gcodetools.py", line 6677, in effect
self.path_to_gcode()
File "gcodetools.py", line 4606, in path_to_gcode
[ self.parse_curve([subpath], layer) for subpath in csp ]
File "gcodetools.py", line 4606, in <listcomp>
[ self.parse_curve([subpath], layer) for subpath in csp ]
File "gcodetools.py", line 3750, in parse_curve
c += biarc(sp1,sp2,0,0) if w==None else biarc(sp1,sp2,-f(w[k][i-1]),-f(w[k][i]))
File "gcodetools.py", line 2327, in biarc
TS, TE = TS.unit(), TE.unit()
File "gcodetools.py", line 1674, in unit
if h: return self / h
TypeError: unsupported operand type(s) for /: 'P' and 'float'
What should have happened?
- firstly, it is not clear why inkscape does not take any notice of the supplied python processor. This should be fixed. The fedora scripts start with !# /usr/bin/python2 -s, yet it throws syntax errors indicating it calling python (ie python3).
- manually changing first line to !# /usr/bin/env python2 similarly is ignored.
- Secondly, using the supposedly python3 ready scripts indicated, it seems these remain untested since this did not get off the ground.
Inkscape Version and Operating System:
Version: 0.92.4 Operating system + version: Fedora 30
Edited by Nathan Lee