[Scribus] cdd_cover.py Traceback

fredd effediwhy
Fri Oct 15 21:08:04 CEST 2004


On Fri, 15 Oct 2004 20:48:48 +0200, Petr Van?k <petr at yarpen.cz> wrote:
> On Friday 15 of October 2004 20:24, fredd wrote:
> 
> 
> > On Fri, 15 Oct 2004 16:22:35 +0200, Jan Ulrich Hasecke
> >
> > <janulrich.hasecke at web.de> wrote:
> > > While playing with scripts, I get this error while executing the script
> > > http://fdubuy.free.fr/scribus/cddb_cover.py
> > >
> > > Exception in Tkinter callback
> > > Traceback (most recent call last):
> > >   File "/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__
> > >     return self.func(*args)
> > >   File "/home/juh/cddb_cover.py", line 123, in get_device
> > >
> > > self.build_cover(self.ent.get(),self.numbering.get(),self.ttime.get())
> > > File "/home/juh/cddb_cover.py", line 227, in build_cover
> > >     SetText(album, b2)
> > > Exception: Fehler: Falsches Argument! Aufruf:setText(unicodetext [,
> > > objectname])
> >
> > You're right, there seems to be a problem with accents. Unfortunately
> > most of my CD are in english so without accents, so I did not find
> > this bug before.
> > python_cddb returns a string which is not in unicode format, and
> > Scribus expects an unicode string.
> > I'll correct this. In the meantime, you should be able to use the
> > script with CDs without accents :)
> 
> there was a bug with accented chars handling in the SetText() procedure.
> It's encouraged to use:
> 
> SetText(unicode(yourText, encoding), objectname)
> 
> so e.g. from the bug:
> SetText(unicode(album, 'utf8'), b2)
> 
thanks Petr for this information.
unfortunately it looks like the encoding argument of the unicode
function is the original encoding, so definitively not utf8 :(
At this time i've updated the
http://fdubuy.free.fr/scribus/cddb_cover.py script with a latin1 to
utf8 converter, so it should work with latin1 alphabets (even with
accents this time), but not other encodings :(
This is a first step before further investigation as soon as I get time to.

Fred




More information about the scribus mailing list