[solved] Error when saving a palette

Post questions on how to use or achieve an effect in Inkscape.
Naga
Posts: 16
Joined: Sat Aug 02, 2008 4:02 am

[solved] Error when saving a palette

Postby Naga » Sat Sep 20, 2008 6:08 pm

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.

Naga
Posts: 16
Joined: Sat Aug 02, 2008 4:02 am

Re: Error when saving a palette

Postby Naga » Sun Sep 21, 2008 4:58 pm

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?

User avatar
blaz_boy
Posts: 94
Joined: Mon Sep 08, 2008 2:25 pm
Location: GFX Dream Land
Contact:

Re: Error when saving a palette

Postby blaz_boy » Sun Sep 21, 2008 9:23 pm

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? :lol: :lol: :lol:
Image

Naga
Posts: 16
Joined: Sat Aug 02, 2008 4:02 am

Re: Error when saving a palette

Postby Naga » Sun Sep 21, 2008 9:58 pm

I'm using Windows, but use cygwin for find, grep and scripting (and much more). :P

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.

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Error when saving a palette

Postby sas » Sun Sep 21, 2008 10:59 pm

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

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.

Naga
Posts: 16
Joined: Sat Aug 02, 2008 4:02 am

Re: Error when saving a palette

Postby Naga » Sun Sep 21, 2008 11:32 pm

Thank you.

It's working now!

User avatar
sas
Posts: 404
Joined: Sat Oct 06, 2007 5:42 am

Re: Error when saving a palette

Postby sas » Mon Sep 22, 2008 1:14 am

I've added the fix to SVN (revision 19900).


Return to “Help with using Inkscape”