bufubaoni / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

bug NoneType object has no attribute 'replace' #137

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.xml_string = drivers_result['diffgram'].as_xml()

What is the expected output? What do you see instead?

What version of the product are you using? On what operating system?
I'm in Centos, using version pysimplesoap 1.12

Please provide any additional information below.
The response is
xml_string = drivers_result['diffgram'].as_xml()
  File "/usr/lib/python2.6/site-packages/PySimpleSOAP-1.12-py2.6.egg/pysimplesoap/simplexml.py", line 116, in as_xml
    return self.__document.toxml('UTF-8')
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 45, in toxml
    return self.toprettyxml("", "", encoding)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 57, in toprettyxml
    self.writexml(writer, "", indent, newl, encoding)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 1749, in writexml
    node.writexml(writer, indent, addindent, newl)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 817, in writexml
    node.writexml(writer,indent+addindent,addindent,newl)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 812, in writexml
    _write_data(writer, attrs[a_name].value)
  File "/usr/lib64/python2.6/xml/dom/minidom.py", line 301, in _write_data
    data = data.replace("&", "&amp;").replace("<", "&lt;")
AttributeError: 'NoneType' object has no attribute 'replace'

Original issue reported on code.google.com by mglo...@narrowcastdigital.com on 26 Feb 2014 at 10:02

GoogleCodeExporter commented 8 years ago
In my local environment is good but in the server is not working

Original comment by mglo...@narrowcastdigital.com on 26 Feb 2014 at 10:04

GoogleCodeExporter commented 8 years ago
It seems that you're passing a None value to some parameter, and it cannot be 
converted correctly to xml

Could you provide a basic test case (python script + wsdl if applicable) to see 
what is going on and how it can be reproduced?

BTW, are you trying the latest version from the repository?

https://pysimplesoap.googlecode.com/archive/default.zip

Original comment by reingart@gmail.com on 26 Feb 2014 at 11:48

GoogleCodeExporter commented 8 years ago
Thank you very much I just fix the bug, I add this lines  on the 
/usr/lib64/python2.6/xml/dom/minidom.py  
if data:
        data = data.replace("&", "&").replace("<", "<"). \
                    replace("\"", """).replace(">", ">")
        writer.write(data)

Thank you for your prompt response, now all is good

Original comment by mglo...@narrowcastdigital.com on 26 Feb 2014 at 11:59