Mercurial > p > roundup > code
comparison roundup/backends/back_sqlite.py @ 4240:289f249ba192
compatibilty fix for pysqlite2 / unicode
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Mon, 10 Aug 2009 04:25:15 +0000 |
| parents | 23ba17d01a24 |
| children | 13b3155869e0 |
comparison
equal
deleted
inserted
replaced
| 4239:5e3991670011 | 4240:289f249ba192 |
|---|---|
| 107 conn.db.sqlite_busy_handler(self.sqlite_busy_handler) | 107 conn.db.sqlite_busy_handler(self.sqlite_busy_handler) |
| 108 else: | 108 else: |
| 109 conn = sqlite.connect(db, timeout=30) | 109 conn = sqlite.connect(db, timeout=30) |
| 110 conn.row_factory = sqlite.Row | 110 conn.row_factory = sqlite.Row |
| 111 | 111 |
| 112 # sqlite3 wants us to store Unicode in the db but that's not what's | 112 # pysqlite2 / sqlite3 want us to store Unicode in the db but |
| 113 # been done historically and it's definitely not what the other | 113 # that's not what's been done historically and it's definitely |
| 114 # backends do, so we'll stick with UTF-8 | 114 # not what the other backends do, so we'll stick with UTF-8 |
| 115 if sqlite_version == 3: | 115 if sqlite_version in (2, 3): |
| 116 conn.text_factory = str | 116 conn.text_factory = str |
| 117 | 117 |
| 118 cursor = conn.cursor() | 118 cursor = conn.cursor() |
| 119 return (conn, cursor) | 119 return (conn, cursor) |
| 120 | 120 |
