When I try to save a palette with save as .gpl, I get an empty palette file and this message:
Inkscape has received additional data from the script executed. The script did not return an error, but this may indicate the results will not be as expected.
Traceback (most recent call last):
File "C:\Program Files\Inkscape\share\extensions\export_gimp_palette.py", line 43, in <module>
walk(dom)
File "C:\Program Files\Inkscape\share\extensions\export_gimp_palette.py", line 20, in walk
checkStyle(node)
File "C:\Program Files\Inkscape\share\extensions\export_gimp_palette.py", line 27, in checkStyle
if node.hasAttributes():
AttributeError: Document instance has no attribute 'hasAttributes'
I have the same problem using two different development versions on Windows.
I have not tried with the 0.46 release version.
[solved] Error when saving a palette
Re: Error when saving a palette
Running find and grep under the Inkscape directory, I found:
$ find . -name \*.py -exec grep -nH hasAttributes {} \;
./python/Lib/xml/dom/minidom.py:822: def hasAttributes(self):
It looks like the minidom.py program is expected to be initialized, but is not.
My snapshot is installed (copied into) in the directory, where version 0.46 was originally installed.
I have Python installed elsewhere and the PATH environment variable points to this Python version.
Could there be a conflict between the two Python installations?
$ find . -name \*.py -exec grep -nH hasAttributes {} \;
./python/Lib/xml/dom/minidom.py:822: def hasAttributes(self):
It looks like the minidom.py program is expected to be initialized, but is not.
My snapshot is installed (copied into) in the directory, where version 0.46 was originally installed.
I have Python installed elsewhere and the PATH environment variable points to this Python version.
Could there be a conflict between the two Python installations?
Re: Error when saving a palette
OK , i'm confused , are you using Windows or Linux ? the first post the error has 'C:\' and the second post has a 'grep' command and '/' ?what is that?
Re: Error when saving a palette
I'm using Windows, but use cygwin for find, grep and scripting (and much more).
I have run SysInternals FileMon utility, and I can see that the above mentioned file minidom.py has been run in connection with trying to save the .gpl file, and there has been no conflicts with the other Python installation.
I have run SysInternals FileMon utility, and I can see that the above mentioned file minidom.py has been run in connection with trying to save the .gpl file, and there has been no conflicts with the other Python installation.
Re: Error when saving a palette
I don't know how this ever worked, unless there has been some incompatible change in xml.dom.minidom between Python versions. Anyway, changing the line
in export_gimp_palette.py to
appears to fix it.
Code: Select all
if node.hasAttributes():
in export_gimp_palette.py to
Code: Select all
if hasattr(node,"hasAttributes") and node.hasAttributes():
appears to fix it.
Re: Error when saving a palette
Thank you.
It's working now!
It's working now!
Re: Error when saving a palette
I've added the fix to SVN (revision 19900).