Index: Lib/sqlite3/test/dbapi.py =================================================================== --- Lib/sqlite3/test/dbapi.py (revision 61105) +++ Lib/sqlite3/test/dbapi.py (working copy) @@ -22,6 +22,10 @@ # 3. This notice may not be removed or altered from any source distribution. import unittest +import os +import os.path +import shutil +import tempfile import threading import sqlite3 as sqlite @@ -121,6 +125,16 @@ return self.fail("should have raised an OperationalError") + def CheckEncodeUnicode(self): + rootpath = tempfile.mkdtemp() + try: + dbpath = os.path.join(rootpath, u'\xe9.db') + sqlite.connect(dbpath).close() + except UnicodeEncodeError: + self.fail('connect() should encode unicode paths to utf-8') + finally: + shutil.rmtree(rootpath) + def CheckClose(self): self.cx.close()