سؤال

I'm getting:

exceptions.TypeError: not all arguments converted during string formatting

from this:

cursor.execute("SELECT * FROM `item` WHERE `url` = %s", (urljoin( base_url, item_url ) ))

Syntax seems fine - any ideas?

هل كانت مفيدة؟

المحلول

The issue here is you are passing in a string, where you should be passing in a tuple. Note the extra comma at the end:

execute("SELECT * FROM `item` WHERE `url` = %s", (urljoin(base_url, item_url),))
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top