Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #61823

Re: TypeError: not all arguments converted during string formatting

From Peter Otten <__peter__@web.de>
Subject Re: TypeError: not all arguments converted during string formatting
Date 2013-12-13 14:33 +0100
Organization None
References <01721890-9bbb-4c90-9668-11a73ef5ea8a@googlegroups.com>
Newsgroups comp.lang.python
Message-ID <mailman.4070.1386941628.18130.python-list@python.org> (permalink)

Show all headers | View raw


Jai wrote:

> my code :

>             sql = """insert into
>             fashion(GENDER,links,category,item_content,price,seller)
>             VAlUES('%s','%s','%s','%s','%s','s')"""
> cursor.execute(sql,(gender,main_link,cat,item_content,price,seller))

This looks very much like your previous mistake

(1) Don't put quotes around the placeholders. They are probably interpreted 
as string literals.

(2) The last placeholder is missing the %
 
> error:
> 
> 
>     query = query % db.literal(args)
> TypeError: not all arguments converted during string formatting

Note that we prefer to see complete tracebacks as this usually simplifies 
debugging a lot.

Back to comp.lang.python | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

TypeError: not all arguments converted during string formatting Jai <jaiprakashsingh213@gmail.com> - 2013-12-13 05:18 -0800
  Re: TypeError: not all arguments converted during string formatting Ervin Hegedüs <airween@gmail.com> - 2013-12-13 14:26 +0100
  Re: TypeError: not all arguments converted during string formatting Peter Otten <__peter__@web.de> - 2013-12-13 14:33 +0100

csiph-web