Virgil Dupras added the comment:

+1 I've been pulling my hair off over this one too. Try this on win32:

Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on
win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import os
>>> os.mkdir(u'foo\xe9')
>>> import sqlite3
>>> con = sqlite3.connect(u'foo\xe9\\my.db')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 3:
ordinal not in range(128)
>>> import sys
>>> sys.getfilesystemencoding()
'mbcs'
>>> con = sqlite3.connect(u'foo\xe9\\my.db'.encode(sys.getfilesystemencoding()))

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
sqlite3.OperationalError: unable to open database file
>>> con = sqlite3.connect(u'foo\xe9\\my.db'.encode('utf-8'))
>>>

----------
nosy: +vdupras

__________________________________
Tracker <[EMAIL PROTECTED]>
<http://bugs.python.org/issue2127>
__________________________________
_______________________________________________
Python-bugs-list mailing list 
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to