A critique of cgi.escape

Georg Brandl g.brandl-nospam at gmx.net
Mon Sep 25 14:02:58 EDT 2006


Jon Ribbens wrote:
> In article <4517eecf$0$14036$edfadb0f at dread15.news.tele.dk>, Max M wrote:
>> Oh ... because you cannot see a use case for that *documented* 
>> behaviour, it must certainly be wrong?
> 
> No, but if nobody else can find one either, that's a clue that maybe
> it's safe to change.
> 
> Here's a point for you - the documentation for cgi.escape says that
> the characters "&", "<" and ">" are converted, but not what they are
> converted to.

It says "to HTML-safe sequences". That's reasonably clear without the need
to reproduce the exact replacements for each character.

If anyone doesn't know what is meant by this, he shouldn't really write apps
using the cgi module before doing a basic HTML course.

Or use the source.

Georg



More information about the Python-list mailing list