python/cgi/html bug

Dan Bishop danb_83 at
Wed Jan 19 06:50:58 CET 2005

Dfenestr8 wrote:
> Hi.
> I've written a cgi messageboard script in python, for an irc chan I
> to frequent.
> Bear with me, it's hard for me to describe what the bug is. So I've
> divided this post into two sections: HOW MY SCRIPTS WORKS, and WHAT
> ...
> The problem is when someone posts a new topic, and that topic happens
> have "" double quotes, or any other strange character, some strange
> glitches occur.

Use cgi.escape(topic, True) to convert HTML special characters to the
equivalent ampersand escape sequences.

More information about the Python-list mailing list