[issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

2009-04-15 Thread Husen daudi

New submission from Husen daudi :

[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("&", "&").replace("<", "<")
[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("&", "&").replace("<", "<")
data = data.replace("\"", """).replace(">", ">")
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 
<http://bugs.python.org/issue5762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

2009-04-15 Thread Husen daudi

Husen daudi  added the comment:

Yes I am using xml.dom.minidom

doc.toprettyxml(indent="\t").encode('utf-8')

--

___
Python tracker 
<http://bugs.python.org/issue5762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

2009-04-15 Thread Husen daudi

Husen daudi  added the comment:

Here is the full traceback...
[2009-04-16 12:00:03,487] ERROR:web-services:[01]: Exception in call:
Traceback (most recent call last):
[2009-04-16 12:00:03,487] ERROR:web-services:[02]:   File
"/home/hda/tiny/bzrtrunk/latest_released/server/bin/wizard/__init__.py",
line 74, in execute_cr
[2009-04-16 12:00:03,487] ERROR:web-services:[03]: action_res =
action(self, cr, uid, data, context)
[2009-04-16 12:00:03,488] ERROR:web-services:[04]:   File
"/home/hda/tiny/bzrtrunk/latest_released/addons/base_module_record/wizard/base_module_save.py",
line 113, in _create_module
[2009-04-16 12:00:03,488] ERROR:web-services:[05]: res_xml =
mod.generate_xml(cr, uid)
[2009-04-16 12:00:03,488] ERROR:web-services:[06]:   File
"/home/hda/tiny/bzrtrunk/latest_released/addons/base_module_record/base_module_record.py",
line 328, in generate_xml
[2009-04-16 12:00:03,488] ERROR:web-services:[07]: #
vim:expandtab:smartindent:tabstop=4:softtabstop=4:shiftwidth=4:
[2009-04-16 12:00:03,488] ERROR:web-services:[08]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
47, in toxml
[2009-04-16 12:00:03,488] ERROR:web-services:[09]: return
self.toprettyxml("", "", encoding)
[2009-04-16 12:00:03,489] ERROR:web-services:[10]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
59, in toprettyxml
[2009-04-16 12:00:03,489] ERROR:web-services:[11]:
self.writexml(writer, "", indent, newl, encoding)
[2009-04-16 12:00:03,489] ERROR:web-services:[12]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
1746, in writexml
[2009-04-16 12:00:03,489] ERROR:web-services:[13]:
node.writexml(writer, indent, addindent, newl)
[2009-04-16 12:00:03,489] ERROR:web-services:[14]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
821, in writexml
[2009-04-16 12:00:03,490] ERROR:web-services:[15]:
node.writexml(writer,indent+addindent,addindent,newl)
[2009-04-16 12:00:03,490] ERROR:web-services:[16]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
821, in writexml
[2009-04-16 12:00:03,490] ERROR:web-services:[17]:
node.writexml(writer,indent+addindent,addindent,newl)
[2009-04-16 12:00:03,490] ERROR:web-services:[18]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
816, in writexml
[2009-04-16 12:00:03,491] ERROR:web-services:[19]:
_write_data(writer, attrs[a_name].value)
[2009-04-16 12:00:03,491] ERROR:web-services:[20]:   File
"/usr/lib/python2.5/site-packages/oldxml/_xmlplus/dom/minidom.py", line
304, in _write_data
[2009-04-16 12:00:03,491] ERROR:web-services:[21]: data =
data.replace("&", "&").replace("<", "<")
[2009-04-16 12:00:03,491] ERROR:web-services:[22]: AttributeError:
'NoneType' object has no attribute 'replace'

--

___
Python tracker 
<http://bugs.python.org/issue5762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue5762] AttributeError: 'NoneType' object has no attribute 'replace'

2009-04-20 Thread Husen daudi

Husen daudi  added the comment:

I have solved this error,
My tag has None value for one attribute.
But python should check for None value in _write_data function.

--

___
Python tracker 
<http://bugs.python.org/issue5762>
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com