[Python-bugs-list] [ python-Bugs-496084 ] unicode, tkfiledialog.py

noreply@sourceforge.net noreply@sourceforge.net
Sat, 22 Dec 2001 03:30:40 -0800


Bugs item #496084, was opened at 2001-12-22 03:30
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=496084&group_id=5470

Category: Unicode
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Klaus-G. Meyer (kgm)
Assigned to: M.-A. Lemburg (lemburg)
Summary: unicode, tkfiledialog.py

Initial Comment:
The file tkfiledialog.py from python/lib/lib-tk 
contains some test code:

if __name__ == "__main__":

    print "open", askopenfilename(filetypes=[("all 
filez", "*")])
    print "saveas", asksaveasfilename()


I tried it, but it won't work, if i select filenames 
with umlaut:

C:\Programme\Python\Lib\lib-tk>python tkfiledialog.py
open
Traceback (most recent call last):
  File "tkfiledialog.py", line 128, in ?
    print "open", askopenfilename(filetypes=[("all 
filez", "*")])
UnicodeError: ASCII encoding error: ordinal not in 
range(128)


The reason is (i think), that askopenfilename 
surprisingly returns unicode string instead of string.

If functions return sometimes unicode strings, how 
should this be done?

Is this a bug or a design problem?

It would be nice, if the test code contains a working 
example.

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=105470&aid=496084&group_id=5470