[Tutor] ValueError

Suzanne Little s349929@student.uq.edu.au
Thu, 25 Jan 2001 10:59:52 +1000 (GMT+1000)


Hello,

I'm hoping someone can suggest a potential solution for why I'm getting
this error.

Quick background:
It's a script that generates an html page. There's a variable (BODY) with
a large  string of html (in ''') and %(var_name)s in various places. The
function takes a dictionary and does some bit's and pieces before
html_string.append(BODY % dictionary) is called. This is where the
following error is occuring.
<--->
File formatter.py, line 271, in build_single
  html_string.append(BODY % dictionary)
ValueError: unsupported format character '"' (0x22)

I figured that I'd forgotten to escape one of my " in the BODY string but
I'm fairly sure that I've gotten them all besides which, if I understand
what I was just looking at in the tutorial, I can have double quotes in my
string if it's inside single quotes and vice versa. (Is this true of
triple quotes ''' " '''?)  The string BODY appears valid and the
dictionary seems fine. (The words appears and seems are deliberate since
something's got to be causing the error :))

So I'm a bit puzzled. This is the second function of this type I've
written and the first was fine. Any ideas where I should be looking?
The code's really too long and ugly to post so hopefully the above is
enough for someone to give me some clues.

Thanks,
Suzanne

--------------------------------------------------------------------------
"Contrariwise," continued Tweedledee, "If it was so, it might be; and if
it were so, it would be; but as it isn't, it ain't.  That's logic"
                             -Lewis Carroll
--------------------------------------------------------------------------