Mercurial > p > roundup > code
comparison roundup/backends/back_sqlite.py @ 4091:09e79cbeb827
force sqlite3 in py2.6+ to treat our stored text as UTF-8
| author | Richard Jones <richard@users.sourceforge.net> |
|---|---|
| date | Thu, 12 Mar 2009 04:29:16 +0000 |
| parents | 59d02edfaa9c |
| children | 23ba17d01a24 |
comparison
equal
deleted
inserted
replaced
| 4090:6f698aef2ad4 | 4091:09e79cbeb827 |
|---|---|
| 106 conn = sqlite.connect(db=db) | 106 conn = sqlite.connect(db=db) |
| 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 | |
| 112 # sqlite3 wants us to store Unicode in the db but that's not what's | |
| 113 # been done historically and it's definitely not what the other | |
| 114 # backends do, so we'll stick with UTF-8 | |
| 115 if sqlite_version == 3: | |
| 116 conn.text_factory = str | |
| 117 | |
| 111 cursor = conn.cursor() | 118 cursor = conn.cursor() |
| 112 return (conn, cursor) | 119 return (conn, cursor) |
| 113 | 120 |
| 114 def open_connection(self): | 121 def open_connection(self): |
| 115 # ensure files are group readable and writable | 122 # ensure files are group readable and writable |
