#149 ascii codec in desktop folders name. (bug)

Official Release
closed
5
2013-01-07
2010-09-16
No

Bug in open wxGlade.wxg file in Finnish Desktop. Finnish Desktop is called Työpöytä with use ASCII codecs.
Generated code is same bug. I move a my wxGlade.wxg source /home/user/ directory and now she generated in py file.
if i a save ass.. a project in Desktop, in Finnish Työpöytä. Same error show but file save.

An exception occurred while loading file "/home/user/Työpöytä/gtranslate/gui/wxGlade.wxg". This is the error message associated with it: 'ASCII' codec can't encode character u'\xf6' in position 15: ordinal not in range(128)

full traceback

user@koti-peli:~/svn/wxglade$ python wxglade.py
loaded code generator for perl
loaded code generator for python
loaded code generator for XRC
loaded code generator for lisp
loaded code generator for C++
Found widgets listing -> /home/user/svn/wxglade/widgets/widgets.txt
loading widget modules:
frame
dialog
panel
splitter_window
notebook
button
toggle_button
bitmap_button
spin_button
text_ctrl
spin_ctrl
slider
gauge
static_text
checkbox
radio_button
radio_box
choice
combo_box
list_box
calendar_ctrl
datepicker_ctrl
static_line
static_bitmap
list_ctrl
tree_ctrl
grid
custom_widget
menubar
toolbar
spacer
Traceback (most recent call last):
File "/home/user/svn/wxglade/main.py", line 662, in _open_app
p.parse(infile)
File "/home/user/svn/wxglade/xml_parse.py", line 304, in parse
try: XmlWidgetBuilder.parse(self, *args)
File "/home/user/svn/wxglade/xml_parse.py", line 69, in parse
self.parser.parse(source)
File "/usr/lib/python2.6/xml/sax/expatreader.py", line 107, in parse
xmlreader.IncrementalParser.parse(self, source)
File "/usr/lib/python2.6/xml/sax/xmlreader.py", line 119, in parse
self.prepareParser(source)
File "/usr/lib/python2.6/xml/sax/expatreader.py", line 111, in prepareParser
self._parser.SetBase(source.getSystemId())
UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 15: ordinal not in range(128)

Discussion

1 2 > >> (Page 1 of 2)
  • i use Ubuntu 10.04 Linux. And wxGlade version are 783a09e0ee04 on Python2.6.5 and wxPython 2.6.3.2.
    wxGlade version are newest clone to Bitbucket,

     
  • Thanks for the report. I have a question though: are you using the Mercurial version of wxGlade available from bitbucket? I thought that this issue had been fixed...

     
  • Hi Tuomas,

    does this bug still exist using the current wxGlade version?

    Regards,
    Carsten

     
  • Pedro M. Baeza
    Pedro M. Baeza
    2012-08-08

    I can confirm the same error in Ubuntu 12.04, Python 2.7.3, wxPython 2.8.12.1, and with wxGlade v0.6.4 and last version of GitHub 9756a246126b.

     
  • File "/usr/lib/python2.6/xml/sax/expatreader.py", line 111, in prepareParser
    self._parser.SetBase(source.getSystemId())
    UnicodeEncodeError: 'ascii' codec can't encode character u'\xf6' in position 15: ordinal not in range(128)
    

    source.getSystemId() contains the file name of the wxg file to open. The automatic conversion to ascii is failing sometimes if the file name is a unicode string.

    A Python bug report exists for this issue in the SAX XML code: http://bugs.python.org/issue11159

    I'll check if I can implement something to get wxGlade working with Unicode files names.

    Could someone an example filename that's causes this issue, please?

     
    • assigned_to: Carsten Grohmann
     
    • status: open --> accepted
     
  • I've implemented a workaround (1152:244a415a4c5b). Could you confirm the solution, please?

     
    • status: accepted --> pending
     
1 2 > >> (Page 1 of 2)