﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	launchpad_bug
2241	exception when trying to attach file to trac ticket	zooko		"ambimorph got this error, and I found this exception in the trac.log:

{{{
2014-06-04 18:33:49,589 Trac[main] ERROR: Internal Server Error: 
Traceback (most recent call last):
  File ""/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/web/main.py"", line 497, in _dispatch_request
    dispatcher.dispatch(req)
  File ""/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/web/main.py"", line 214, in dispatch
    resp = chosen_handler.process_request(req)
  File ""/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/attachment.py"", line 512, in process_request
    data = self._do_save(req, attachment)
  File ""/usr/local/lib/python2.7/dist-packages/Trac-1.0.1-py2.7.egg/trac/attachment.py"", line 733, in _do_save
    attachment):
  File ""build/bdist.linux-x86_64/egg/tracspamfilter/adapters.py"", line 139, in validate_attachment
    FilterSystem(self.env).test(req, author, changes)
  File ""build/bdist.linux-x86_64/egg/tracspamfilter/filtersystem.py"", line 277, in test
    score, reasons, [req.path_info, req.args]).insert()
  File ""build/bdist.linux-x86_64/egg/tracspamfilter/model.py"", line 139, in insert
    self._request_to_xml(self.request)))
  File ""build/bdist.linux-x86_64/egg/tracspamfilter/model.py"", line 297, in _request_to_xml
    return ElementTree.tostring(root)
  File ""/usr/lib/python2.7/xml/etree/ElementTree.py"", line 1127, in tostring
    ElementTree(element).write(file, encoding, method=method)
  File ""/usr/lib/python2.7/xml/etree/ElementTree.py"", line 821, in write
    serialize(write, self._root, encoding, qnames, namespaces)
  File ""/usr/lib/python2.7/xml/etree/ElementTree.py"", line 940, in _serialize_xml
    _serialize_xml(write, e, encoding, qnames, None)
  File ""/usr/lib/python2.7/xml/etree/ElementTree.py"", line 933, in _serialize_xml
    v = _escape_attrib(v, encoding)
  File ""/usr/lib/python2.7/xml/etree/ElementTree.py"", line 1093, in _escape_attrib
    _raise_serialization_error(text)
  File ""/usr/lib/python2.7/xml/etree/ElementTree.py"", line 1053, in _raise_serialization_error
    ""cannot serialize %r (type %s)"" % (text, type(text).__name__)
TypeError: cannot serialize None (type NoneType)
}}}

She reports that she then tried the exact same operation again -- attaching the exact same file to the exact same ticket, and this time it worked.

[timeline?from=Jun+4%2C+2014&daysback=1&authors=&changeset=on&milestone=on&ticket=on&ticket_details=on&wiki=on&update=Update The Timeline] shows her successful attachment operation.

Doubtless this is related to #1581, although note that we upgraded to trac v1.0.1 since #1581 last reared its ugly head."	defect	new	normal	undecided	dev-infrastructure	1.10.0		trac		
