[Sqlalchemy-tickets] Issue #3089: sqlite db with non-ascii characters in path (zzzeek/sqlalchemy)
Brought to you by:
zzzeek
|
From: Scott H. <iss...@bi...> - 2014-06-19 19:48:03
|
New issue 3089: sqlite db with non-ascii characters in path https://bitbucket.org/zzzeek/sqlalchemy/issue/3089/sqlite-db-with-non-ascii-characters-in Scott Horowitz: If you have a database path with non-ascii characters (e.g., "Á"), then sqlalchemy will fail with: "unable to open database file None None" Python's sqlite3 also exhibits this behavior. However, you can workaround this in sqlite3 by doing: ``` #!python import sqlite3, os os.chdir("/path/with/non/ascii/character") conn = sqlite3.connect("file.db") ``` This does not work with sqlalchemy, however, because the create_connect_args() method in sqlalchemy\dialects\sqlite\pysqlite3.py has the following code where an absolute path is always provided to sqlite: ``` #!python if filename != ':memory:': filename = os.path.abspath(filename) ``` If this code is removed, then the workaround works as expected. That said, it will not resolve the issue of non-ascii characters in the filename itself, just the path. |