[New-bugs-announce] [issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

Husen daudi report at bugs.python.org
Wed Apr 15 14:34:34 CEST 2009


New submission from Husen daudi <hda at openerp.co.in>:

[2009-04-15 17:53:10,198] ERROR:web-services:[19]:    
_write_data(writer, attrs[a_name].value)
[2009-04-15 17:53:10,198] ERROR:web-services:[20]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
305, in _write_data
[2009-04-15 17:53:10,199] ERROR:web-services:[21]:     data =
data.replace("&", "&amp;").replace("<", "&lt;")
[2009-04-15 17:53:10,199] ERROR:web-services:[22]: AttributeError:
'NoneType' object has no attribute 'replace'

_write_data dunction should be something like this
def _write_data(writer, data):
    "Writes datachars to writer."
    if data:
        data = data.replace("&", "&amp;").replace("<", "&lt;")
        data = data.replace("\"", "&quot;").replace(">", "&gt;")
        writer.write(data)

----------
components: XML
messages: 85990
nosy: hda
severity: normal
status: open
title: AttributeError: 'NoneType' object has no attribute 'replace'
type: crash
versions: Python 2.5

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue5762>
_______________________________________


More information about the New-bugs-announce mailing list