Skip to content

Commit

Permalink
Lowercase SQL 'insert' for Turkish locale
Browse files Browse the repository at this point in the history
Python issue 13099 means that we can't get the last row ID after a capitalised
'INSERT' to an sqlite3 database, if the locale is set to Turkish. This should
be fixed in Python 2.7.3 and 3.2.3, but in the meantime, lowercase insert
should be fine.
  • Loading branch information
takluyver committed Oct 4, 2011
1 parent fcafc40 commit a7f24ab
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion IPython/core/history.py
Expand Up @@ -152,7 +152,11 @@ def new_session(self, conn=None):
conn = self.db

with conn:
cur = conn.execute("""INSERT INTO sessions VALUES (NULL, ?, NULL,
# N.B. 'insert into' here is lower case because of a bug in the
# sqlite3 module that affects the Turkish locale. This should be
# fixed for Python 2.7.3 and 3.2.3, as well as 3.3 onwards.
# http://bugs.python.org/issue13099
cur = conn.execute("""insert into sessions VALUES (NULL, ?, NULL,
NULL, "") """, (datetime.datetime.now(),))
self.session_number = cur.lastrowid

Expand Down

0 comments on commit a7f24ab

Please sign in to comment.