Unsupported Format Character '&' (0x26)

Peter Otten __peter__ at web.de
Thu Aug 19 13:35:01 CEST 2010

Andrew Evans wrote:

> On Wed, Aug 18, 2010 at 4:35 PM, Andrew Evans <randrange at gmail.com> wrote:
>> I get an error message "Unsupported Format Character '&' (0x26)" I
>> narrowed it down to these two variables
>> any idea how to fix it?
>>   SEARCH_URL_0 = "http://search.yahoo.com/search...?p=%(query)..."

> nvm I got it by adding s and d respectively after each value eg %(query)s

If you want to handle this reliably have a look at urllib.urlencode().


More information about the Python-list mailing list