Ordinal not in range exception

Bug #591471 reported by Joel
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Scour
Incomplete
Undecided
Unassigned

Bug Description

When launching scour to clean my svg (I have many gradients I am not using anymore, and I want to shrink the list), I have that output :
me@home:$ python scour.py -i myFile.svg -o output.svg
scour 0.24
Copyright Jeff Schiller, 2010
Traceback (most recent call last):
  File "scour.py", line 2432, in <module>
    out_string = scourString(in_string, options).encode("UTF-8")
  File "scour.py", line 2274, in scourString
    embedRasters(elem, options)
  File "scour.py", line 1919, in embedRasters
    href = os.path.join(os.path.dirname(infilename), href)
  File "/usr/lib/python2.6/posixpath.py", line 70, in join
    path += '/' + b
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 13: ordinal not in range(128)

I can give the input file if needed, but I prefer not to publish it publicly.

Thanks for developping this kind of software, it can (should ?) definitely be integrated into Inkscape in the future...

Revision history for this message
jazzynico (jazzynico) wrote :

Looks like there's something wrong with an image path. Do you use special characters (letters with accents...) in an xlink:href attributes?

> , it can (should ?) definitely be integrated into Inkscape in the future...

It is already in Inkscape 0.47, in File>Save As>Optimized SVG.

Revision history for this message
Joel (joel-schaal) wrote : Re: [Bug 591471] Re: Ordinal not in range exception

Aha ! That is it, probably. I admit I use paths with accents.

I never used another "Save as" option as the standard SVG, (and never looked
at the possibilities), so I haven't seen that. I also should have read the
scour documentation more thoroughly, because I saw that it is also written
there.

Sorry :)

(but thank you for the work nevertheless !)

2010/6/9 JazzyNico <email address hidden>

> Looks like there's something wrong with an image path. Do you use
> special characters (letters with accents...) in an xlink:href
> attributes?
>
> > , it can (should ?) definitely be integrated into Inkscape in the
> future...
>
> It is already in Inkscape 0.47, in File>Save As>Optimized SVG.
>
> --
> Ordinal not in range exception
> https://bugs.launchpad.net/bugs/591471
> You received this bug notification because you are a direct subscriber
> of the bug.
>

Revision history for this message
Louis Simard (louis-simard-deactivatedaccount) wrote :

What is your file's XML declaration?

By that, I mean the <?xml ... ?> at the start of the file.

Perhaps it's UTF-8 and Scour doesn't handle it gracefully, or else it's ISO-8859-1 or ASCII so you can't have those characters in your SVG file.

Changed in scour:
status: New → Incomplete
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.