Skip to content

Instantly share code, notes, and snippets.

@netdesign
Created September 16, 2011 14:45
Show Gist options
  • Select an option

  • Save netdesign/1222268 to your computer and use it in GitHub Desktop.

Select an option

Save netdesign/1222268 to your computer and use it in GitHub Desktop.
class updateDiscHandler(BaseHandler):
def get(self):
owner=self.get_argument("owner")
uid=self.get_argument("uid")
title=self.get_argument("title")
description=self.get_argument("descr")
genre=self.get_argument("gen")
code=self.get_argument("code")
cover=self.get_argument("cover")
print owner
print uid
print description.encode('utf-8')
print genre
print code
print cover
conn = oursql.connect(host="", user="", passwd="", db="")
curs = conn.cursor(plain_query=True)
curs.execute("UPDATE discs SET title=?, abstract=?, gen=?, code=?, cover=? WHERE uid=? and owner=?", (title, description, genre, code, cover, uid, owner))
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 810, in _stack_context
yield
File "/usr/local/lib/python2.7/site-packages/tornado/stack_context.py", line 77, in StackContext
yield
File "/usr/local/lib/python2.7/site-packages/tornado/web.py", line 827, in _execute
getattr(self, self.request.method.lower())(*args, **kwargs)
File "myDB1.py", line 600, in get
curs.execute("UPDATE discs SET title=?, abstract=?, gen=?, code=?, cover=? WHERE uid=? and owner=?", (title, description, genre, code, cover, uid, owner))
File "cursor.pyx", line 122, in oursql.Cursor.execute (oursqlx/oursql.c:15820)
File "statement.pyx", line 407, in oursql._Statement.execute (oursqlx/oursql.c:10345)
File "util.pyx", line 91, in oursql._do_warnings_query (oursqlx/oursql.c:3459)
CollatedWarningsError: (None, 'query caused warnings', [(<class 'oursql.Warning'>, (u"Incorrect string value: '\\xE2\\x80\\x8B\\xE2\\x80\\x8B...' for column 'abstract' at row 6", 1366L))])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment