Re: A critique of cgi.escape



Lawrence D'Oliveiro wrote:

So I think the default for the second argument to cgi.escape should be
changed to True. Or alternatively, the second argument should be removed
altogether, and quotes should always be escaped.

you're confused: cgi.escape(s) is designed to be used for ordinary text, cgi.escape(s, True) is designed for attributes. if you use the code the way it's intended to be used, it works perfectly fine.

Can changing the default break existing scripts? I don't see how. It might
even fix a few lurking bugs out there.

I'm not sure this "every time I don't immediately understand something, I'll write a change proposal instead of reading the library reference" approach is healthy, really.

</F>

.



Relevant Pages

  • Re: "Sgt. Pepper"...the bomb of all bombs?
    ... >>Well, that's another issue altogether, but the question was ... >>decor. ... > And he couldn't even get the continuity right for 'Tommy.' ... > should tell you what I think of Lawrence, ...
    (rec.music.beatles)
  • Re: A critique of cgi.escape
    ... In message, Fredrik ... Lundh wrote: ... altogether, and quotes should always be escaped. ...
    (comp.lang.python)
  • Re: Australia , good decision
    ... I hadn't seen these quotes from the ... politicians in any of the mainstream papers, and have no idea who Lawrence ...
    (soc.culture.malaysia)
  • Re: QuoteSQL
    ... Lawrence D'Oliveiro enlightened us with: ... Including all sorts of quotes, newlines, backslashes etc. in the name. ...
    (comp.lang.python)