Skip to content

Instantly share code, notes, and snippets.

@josuebrunel
Created August 30, 2016 13:07
Show Gist options
  • Save josuebrunel/389ef3814e4cdc8f8f8e0bf53cb00302 to your computer and use it in GitHub Desktop.
Save josuebrunel/389ef3814e4cdc8f8f8e0bf53cb00302 to your computer and use it in GitHub Desktop.
def cp_file(infile, outfile):
with open(outfile, 'wb') as fo:
fd = open(infile, 'rb')
for line in fd.readlines():
fo.write('%s' % line)
@josuebrunel
Copy link
Author

Traceback (most recent call last):
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1065, in _escape_cdata
    if "&" in text:
TypeError: argument of type 'int' is not iterable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "logger.py", line 159, in <module>
    MainMXM(test)
  File "logger.py", line 36, in MainMXM
    infoDomaine("yahoo.com",line,limit_line,data1,filename)
  File "logger.py", line 88, in infoDomaine
    Elemen_in_file(filename,domaine,data)
  File "logger.py", line 153, in Elemen_in_file
    save_data(data,filename)
  File "/media/gloire/PACO/testemxm/xml_data.py", line 71, in save_data
    xml_data = tree.tostring(domaine)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1123, in tostring
    short_empty_elements=short_empty_elements)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 775, in write
    short_empty_elements=short_empty_elements)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 940, in _serialize_xml
    short_empty_elements=short_empty_elements)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 937, in _serialize_xml
    write(_escape_cdata(text))
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1073, in _escape_cdata
    _raise_serialization_error(text)
  File "/usr/lib/python3.5/xml/etree/ElementTree.py", line 1056, in _raise_serialization_error
    "cannot serialize %r (type %s)" % (text, type(text).__name__)
TypeError: cannot serialize 1 (type int)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment