comments.py error

=?ks_c_5601-1987?B?vcm787i4?= <[email protected]>
Newsgroups gmane.comp.web.pyblosxom.user
Message-ID <[email protected]>
If user don¡¯t offer an email address, it is failed to show html¡¦ 

 

def makeXMLField(name, field):
        return "<"+name+">"+cgi.escape(field[name])+"</"+NAME+">\n"

 

error page reports that field[¡°email¡±] throws KeyError

 

so I changed this code to 

 

 

    def makeXMLField(name, field):

        try :

            result = "<"+name+">"+cgi.escape(field[name])+"</"+name+">\n"

        except KeyError, e:

            result = "<"+name+">"+"nomail-/[email protected]"+"</"+name+">\n"

 

        return result

 

 

Does it makes any problem?

 

I am sang man sim
winmail.dat (application/ms-tnef, 5.4 KB) - not displayed
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.