[ python-Bugs-1007046 ] os.startfile() doesn't accept Unicode filenames

SourceForge.net noreply at sourceforge.net
Sun Jun 26 23:24:09 CEST 2005


Bugs item #1007046, was opened at 2004-08-11 08:47
Message generated for change (Comment added) made by birkenfeld
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1007046&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Extension Modules
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Matthias Huening (huening)
>Assigned to: Raymond Hettinger (rhettinger)
Summary: os.startfile() doesn't accept Unicode filenames

Initial Comment:
WinXP, Python 2.3.4

os.startfile() seems to have problems with Unicode
filenames. Example:

>>> import tkFileDialog
>>> import os
>>> f = tkFileDialog.askopenfilename()
>>> type(f)
<type 'unicode'>
>>> os.startfile(f)

Traceback (most recent call last):
  File "<pyshell#10>", line 1, in -toplevel-
    os.startfile(f)
UnicodeEncodeError: 'ascii' codec can't encode
characters in position 14-16: ordinal not in range(128)
>>> 



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

>Comment By: Reinhold Birkenfeld (birkenfeld)
Date: 2005-06-26 23:24

Message:
Logged In: YES 
user_id=1188172

Attaching a patch which should fix that.

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

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


More information about the Python-bugs-list mailing list