fsmMLK / inkscapeDimensions

Inkscape extension to assist creating dimension annotations.
GNU General Public License v3.0
64 stars 10 forks source link

Syntax Error | Inkscape 1.0 #9

Closed erikscott128 closed 3 years ago

erikscott128 commented 4 years ago

I get the following syntax error when running in Inkscape 1.0

Traceback (most recent call last):
  File "dimensions.py", line 7, in <module>
    import inkscapeMadeEasy_Draw as inkDraw
  File "C:\Users\Erik Scott\AppData\Roaming\inkscape\extensions\inkscapeMadeEasy_Draw.py", line 44, in <module>
    import textextLib.textext as textext
  File "C:\Users\Erik Scott\AppData\Roaming\inkscape\extensions\textextLib\textext.py", line 120
    except StandardError, e:
                        ^
SyntaxError: invalid syntax

I have both the dimensions and InkscapeMadeEasy files installed in the user extensions directory. Error occurs when hitting "apply" or "live preview."

cocoa1231 commented 4 years ago

Can confirm that I'm experiencing this on elementary OS 5.0 with inkscape 1.0 (1.0+r73+1) Full error

/usr/lib/python3/dist-packages/apport/report.py:13: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import fnmatch, glob, traceback, errno, sys, atexit, locale, imp
Traceback (most recent call last):
  File "dimensions.py", line 7, in <module>
    import inkscapeMadeEasy_Draw as inkDraw
  File "/home/elementarycocoa/.config/inkscape/extensions/inkscapeMadeEasy_Draw.py", line 44, in <module>
    import textextLib.textext as textext
  File "/home/elementarycocoa/.config/inkscape/extensions/textextLib/textext.py", line 120
    except StandardError, e:
                        ^
SyntaxError: invalid syntax
wdb07124 commented 3 years ago

I am currently experiencing this issue as well. Did you find a work around?

fsmMLK commented 3 years ago

This is an issue when you use the extension with inkscape v1.0. Inkscape 1.0 now uses python 3 and there is a syntax change in except statements. My plugins are not yet adapted to run with v.10. I am no currently working on the update, but it might take some time to be able to push the official update to github.

A hotfix you can try is to replace any instance of:

except something, something_else:

by

except something as something_else:

(replace the comma with 'as')

jbird4141 commented 3 years ago

I replaced all commas with as in textext.py where all the errors were coming from. There were 3. And am now getting this error:

inkscape\extensions\textextLib\textext.py", line 63, in import os, sys, tempfile, traceback, glob, re, md5, copy ModuleNotFoundError: No module named 'md5'