From 4f43e5c4353325eb8d1c455c58e299ef95e2e422 Mon Sep 17 00:00:00 2001 From: Tim Graham Date: Sat, 14 Feb 2015 20:46:11 -0500 Subject: [PATCH] [1.8.x] Refs #24324 -- Fixed UnicodeEncodeError in SQLite backend while testing. If 'name' contained non-ASCII characters, the comparison raised a UnicodeEncodeError on Python 2. Backport of 63c5c9870129f6b81358c1ed7ed2392bbc46f77d from master --- django/db/backends/sqlite3/base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/django/db/backends/sqlite3/base.py b/django/db/backends/sqlite3/base.py index 84d24e5bfe..6eb39ad2c3 100644 --- a/django/db/backends/sqlite3/base.py +++ b/django/db/backends/sqlite3/base.py @@ -299,7 +299,7 @@ class DatabaseWrapper(BaseDatabaseWrapper): self.cursor().execute("BEGIN") def is_in_memory_db(self, name): - return name == ":memory:" or "mode=memory" in name + return name == ":memory:" or "mode=memory" in force_text(name) FORMAT_QMARK_REGEX = re.compile(r'(?