Python argv and special characters

trapeze.jsg at gmail.com trapeze.jsg at gmail.com
Fri Sep 23 03:49:27 EDT 2005


Hi.

Platform:             Win XP
Python version:       2.4.1
Running script from:  cmd.exe (windows console)

I am having some trouble passing arguments to a python script having
special characters. In my case the argument is a filename (eg.
udtræk.xml). It seems like python tries to guess the encoding in which
the arguments are passed, instead of just recieving them in unicode,
thus using main() instead of wmain() inside the interpreter. So I get
an exception "IOError: [Errno 2] No such file or directory:
'udtr\xe6k.xml'" as a result.

How can I ensure a safe passing of arguments maybe having speciel
characters within.

Best Regards 
Jakob Simon-Gaarde




More information about the Python-list mailing list