Skip to content

Commit

Permalink
fix issue OpenTransitTools#18 -- utf8 support with sqlite
Browse files Browse the repository at this point in the history
  • Loading branch information
kardaj committed Jun 11, 2018
1 parent c371e7e commit bc8138a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions gtfsdb/model/db.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import logging
import sqlite3

from gtfsdb import config
from sqlalchemy import create_engine
Expand Down Expand Up @@ -123,6 +124,7 @@ def url(self, val):
self._url = val
self.engine = create_engine(val)
if self.is_sqlite:
sqlite3.register_adapter(str, lambda s: s.decode('utf8'))
self.engine.connect().connection.connection.text_factory = str
session_factory = sessionmaker(self.engine)
self.session = scoped_session(session_factory)
Expand Down

0 comments on commit bc8138a

Please sign in to comment.