Connecting Tech Pros Worldwide Forums | Help | Site Map

open file with non-ascii path

Member
 
Join Date: Aug 2007
Location: Earth
Posts: 88
#1: Aug 16 '09
Hi all,

I am trying to open a file that contains non-ascii characters in its file path,

e.g. "c:\path\<non-ascii>.file"

I have found lots of information on the Internets
- unicode()
- # -*- coding: <encode type> -*-
- encode()/decode()

They correctly change characters to the output screen, but the "open()" function really don't give a ***, it just refuse to accept the changes???!!!

What am I missing? This is driving me crazy (almost made me cry...)

I run python 3.0 on Windows, and sys.getfilesystemencoding() gives me "mbcs",

Please help...

Member
 
Join Date: Aug 2007
Location: Earth
Posts: 88
#2: Aug 16 '09

re: open file with non-ascii path


This is so embarrassing...

I was giving the wrong path to the file... *blushes*

It had nothing to do with encoding, but if anyone has a problem with that, have a look at: http://docs.python.org/dev/3.0/howto...code-filenames

Still, I would blame it Python, really it should give more informative error messages...

... And be able to make coffee...

You know what else would be nice, yes a bl---
Reply