On Dec 8, 2008, at 10:44 AM, Christoph Zwerschke wrote:
> Here are two small problems I already stumbled upon:
>
> First, in dbApp.py there is the following line:
>
> sysFile = os.path.join(sp, connFile)
>
> Now on my Win XP system, "sp" happened to be a utf-8 encoded filename
> with non-ascii chars, while "connFile" was a unicode string. This
> crashed because Python did not know how to encode the connFile string.
> The following quick fix worked (but is maybe not right on Unix?)
>
> sysFile = os.path.join(sp, connFile.encode('utf-8'))
That's a one-off solution; systems using different encodings, or code
that passes in an encoded value will fail.
I'm having a hard time reproducing this. I've names some directories
with non-ASCII characters, and run os.path.join with those directories
and all sorts of values for 'connFile', and the join method was able
to handle it. Can you tell me what you get when you type the following:
import os
print os.path.supports_unicode_filenames
-- Ed Leafe
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users
Searchable Archives: http://leafe.com/archives/search/dabo-users
This message: http://leafe.com/archives/byMID/[EMAIL PROTECTED]