Trouble with the encoding of os.getcwd() in Korean Windows

Walter Dörwald walter at livinglogic.de
Wed Feb 9 12:11:02 EST 2005


Erik Bethke wrote:
> Hello All,
> 
> sorry for all the posts... I am *almost* there now...
> 
> okay I have this code:
> 
> import sys, os
> 
>       encoding = locale.getpreferredencoding()
>       htmlpath = os.getcwd()
>       htmlpath = htmlpath.decode( encoding )

You might want to try os.getcwdu() instead of this. According to
http://www.python.org/doc/2.4/lib/os-file-dir.html
this has been added in Python 2.3 and should work on Windows.

Bye,
    Walter Dörwald



More information about the Python-list mailing list