Failure of FancyText.py demo in Wxpython 2.8.9.2

Hi:

  I am using debian testing, python 2.5 and wxpython 2.8.9.2. When I run
demo.py from wx2.8-examples, the greek letters <Alpha/>,... <alpha/> ..
don't display. I tried to run fancytext.py from
wx2.8-gtk2-unicode/wx/lib/ and that gave the following errors:

python fancytext.py
Traceback (most recent call last):
  File "fancytext.py", line 451, in <module>
    sft = StaticFancyText(frame, -1, testText)
NameError: name 'testText' is not defined
scanagar@canax2:~/python/wxpython$ vim fancytext.py
scanagar@canax2:~/python/wxpython$ python fancytext.py
Traceback (most recent call last):
  File "fancytext.py", line 461, in <module>
    test()
  File "fancytext.py", line 451, in test
    sft = StaticFancyText(frame, -1, testText)
  File "fancytext.py", line 396, in __init__
    bmp = RenderToBitmap(text, background)
  File "fancytext.py", line 357, in RenderToBitmap
    width, height, dy = GetFullExtent(str, dc, enclose)
  File "fancytext.py", line 347, in GetFullExtent
    RenderToRenderer(str, renderer, enclose)
  File "fancytext.py", line 330, in RenderToRenderer
    p.Parse(str, 1)
  File "fancytext.py", line 122, in startElement
    getattr(self, method)(attrs)
  File "fancytext.py", line 239, in start
    self.characterData(code)
  File "fancytext.py", line 140, in characterData
    width, height, descent, extl = self.dc.GetFullTextExtent(chunk)
  File
"/usr/lib/python2.5/site-packages/wx-2.8-gtk2-unicode/wx/_gdi.py", line
3741, in GetFullTextExtent
    return _gdi_.DC_GetFullTextExtent(*args, **kwargs)
  File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc1 in position 0:
unexpected end of data
(END)

Am I missing some files? I found that I do not have guitest.py ( this
does not appear to be in the debian distribution), but this should not
have affected the display of the Greek characters in the demo of
FancyText.py.

Thanks.

Sebastian

Sebastian Canagaratna
Department of chemistry
Ohio Northern University
Ada, OH 45810

Sebastian Canagaratna wrote:

    return _gdi_.DC_GetFullTextExtent(*args, **kwargs)
  File "/usr/lib/python2.5/encodings/utf_8.py", line 16, in decode
    return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xc1 in position 0:
unexpected end of data
(END)

Am I missing some files?

No, this seems to be a problem with unicode and the expat module.

http://lists.wxwidgets.org/pipermail/wxpython-users/2009-February/084318.html

I'd be happy to apply a patch to fancytext that works around this in some way, but I don't have time to chase it myself right now.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!