TypeError: decoding Unicode is not supported: "embedimage.py", line 72
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Inkscape |
Fix Released
|
Medium
|
Aapo Rantalainen |
Bug Description
LANG: fi_FI.UTF-8
Python: 2.7.3
Inkscape: 0.48.3.1-1ubuntu1
Linux 3.2.0-27-generic #43-Ubuntu SMP Fri Jul 6 14:25:57 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
This is reproducible with large (non-releasable production) file. I'm still looking smallest test case to reproduce it.
Svg-file with linked png-images. Some image might have changed places (in filesystem), but everything is visible correctly.
Fields "sodipodi:absref" and/or "xlink:href" contain non-ascii characters (namely 'ö' and 'ä').
"Extensions" -> "Images" -> "Embed images...":
Traceback (most recent call last):
File "embedimage.py", line 106, in <module>
e.affect()
File "/usr/local/
self.effect()
File "embedimage.py", line 38, in effect
self.
File "embedimage.py", line 52, in embedAll
self.
File "embedimage.py", line 72, in embedImage
path=
TypeError: decoding Unicode is not supported
Workaround:
path=''
#path selection strategy:
# 1. href if absolute
# 2. realpath-ified href
# 3. absref, only if the above does not point to a file
if (href != None):
if (not os.path.
if (absref != None):
-path=unicode(path, "utf-8")
+try:
+ path=unicode(path, "utf-8")
+except TypeError:
+ path=path
Seems all path selection strategy is not returning in same format (unicode/utf8).
Related branches
summary: |
- ypeError: decoding Unicode is not supported: "embedimage.py", line 72, - in embedImage + TypeError: decoding Unicode is not supported: "embedimage.py", line 72 |
tags: | added: encoding extensions-plugins |
Changed in inkscape: | |
status: | Fix Committed → Fix Released |
Confirmed on Windows XP, Inkscape trunk revision 11871.