Monday, October 27, 2014

TypeError: can't concat bytes to tuple

Hi all,

I am running below program : http://palewi.re/posts/2008/04/26/python-recipe-connect-to-mysql-database-execute-a-query-print-the-results/

on Centos 6.4 , Python 3.4 but not sure why it is failing with below exception :

root@db2 bin]# python printfields_new.py datbase1 tb_sime_darby
Wikified HTML for adunit.tb_sime_darby
========================
Traceback (most recent call last):
  File "printfields_new.py", line 33, in <module>
    PrintFields(users_database, users_table)
  File "printfields_new.py", line 12, in PrintFields
    mysql.execute(sql)
  File "/usr/local/lib/python3.4/site-packages/pymysql/cursors.py", line 132, in execute
    result = self._query(query)
  File "/usr/local/lib/python3.4/site-packages/pymysql/cursors.py", line 271, in _query
    conn.query(q)
  File "/usr/local/lib/python3.4/site-packages/pymysql/connections.py", line 725, in query
    self._execute_command(COM_QUERY, sql)
  File "/usr/local/lib/python3.4/site-packages/pymysql/connections.py", line 888, in _execute_command
    self._write_bytes(prelude + sql[:chunk_size-1])
TypeError: can't concat bytes to tuple

Anyone has any idea about this ? Also , how can we make sure to prevent from Identation erros in python ?

Thanks

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/54bfc5a3-1336-4c26-ad49-8af2a2da4ab8%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment