Calendar extension doesn't work

Bug #320496 reported by Alexandre Prokoudine
4
Affects Status Importance Assigned to Milestone
Inkscape
Fix Released
Undecided
Aurium

Bug Description

Traceback (most recent call last):
  File "/usr/share/inkscape/extensions/svgcalendar.py", line 294, in <module>
    e.affect()
  File "/usr/share/inkscape/extensions/inkex.py", line 175, in affect
    self.effect()
  File "/usr/share/inkscape/extensions/svgcalendar.py", line 287, in effect
    self.create_month(m)
  File "/usr/share/inkscape/extensions/svgcalendar.py", line 221, in create_month
    self.write_month_header(g, m)
  File "/usr/share/inkscape/extensions/svgcalendar.py", line 192, in write_month_header
    inkex.etree.SubElement(g, 'text', txt_atts).text = self.options.month_names[m-1]
  File "lxml.etree.pyx", line 826, in lxml.etree._Element.text.__set__ (src/lxml/lxml.etree.c:9564)
  File "apihelpers.pxi", line 581, in lxml.etree._setNodeText (src/lxml/lxml.etree.c:30511)
  File "apihelpers.pxi", line 1136, in lxml.etree._utf8 (src/lxml/lxml.etree.c:34600)
ValueError: All strings must be XML compatible: Unicode or ASCII, no NULL bytes

Changed in inkscape:
assignee: nobody → aurium
Revision history for this message
Alvin Penner (apenner) wrote :

very cool extension, great job !!

I've added some support for iso-8859-1 characters, file attached.
I believe this should solve the problem, could someone else confirm this ?

hth,
Alvin

Changed in inkscape:
status: New → Confirmed
Revision history for this message
Alvin Penner (apenner) wrote :

patch committed to svn rev 20575

Revision history for this message
Aurium (aurium) wrote :

Thanks Alvin!

I change it to support other encodings. I think the problem is resolved.

Changed in inkscape:
status: Confirmed → Fix Committed
Revision history for this message
Alvin Penner (apenner) wrote :

wow, I had no idea there were so many encodings. Just a quick question : when I select Latin iso 8859-15 then I get a normal rendering as expected, including a few deliberate non-ASCII codes like ± and è.

when I select us-ascii, or UTF-8, then I get the Python message :

You must select your correct system encode.

do I need to install something to use these other encodings?

Revision history for this message
Alvin Penner (apenner) wrote :

sorry, let me erase that question, I finally figured it out. Not all ascii codes are useable. I just assumed that all the first 255 ASCII codes would always be decoded, but that is not true. So I guess my characters ± and è were illegal in utf-8 and I guess everything above 127 is illegal in us-ascii.
    so this looks good to me, probably there are other extensions that might benefit from such an input procedure.

Thanks,
Alvin

Revision history for this message
Alvin Penner (apenner) wrote :

 sorry to go on like this, but since some of the more common symbols like (é è ± ° ½) don't work in utf-8, it might be worthwhile to choose something else as the default.
 Perhaps latin1, which works for all of these symbols.

Revision history for this message
Aurium (aurium) wrote :

The symbols (é è ± ° ½) and all other symbols are represented in the UTF-8 table.

The system encoding selector is for you declare your system encoding for python discover how to read the input data correctly. Your system is ISO-8859-15, so, your input is in this encoding. If you select other encoding the python will not understand your input.

Will be good if we discover that automatically. :-)

jazzynico (jazzynico)
Changed in inkscape:
status: Fix Committed → Fix Released
tags: added: extensions-plugins
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.