Strip control characters from News in the RSS feed
Without this we could get an UnserializableContentError exception like this:
Traceback:
File "/usr/lib/python3/dist-packages/django/core/handlers/exception.py" in inner
41. response = get_response(request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
187. response = self.process_exception_by_middleware(e, request)
File "/usr/lib/python3/dist-packages/django/core/handlers/base.py" in _get_response
185. response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/python3/dist-packages/django/contrib/syndication/views.py" in __call__
48. feedgen.write(response, 'utf-8')
File "/usr/lib/python3/dist-packages/django/utils/feedgenerator.py" in write
248. self.write_items(handler)
File "/usr/lib/python3/dist-packages/django/utils/feedgenerator.py" in write_items
259. self.add_item_elements(handler, item)
File "/usr/lib/python3/dist-packages/django/utils/feedgenerator.py" in add_item_elements
309. handler.addQuickElement("description", item['description'])
File "/usr/lib/python3/dist-packages/django/utils/xmlutils.py" in addQuickElement
20. self.characters(contents)
File "/usr/lib/python3/dist-packages/django/utils/xmlutils.py" in characters
27. raise UnserializableContentError("Control characters are not supported in XML 1.0")
Exception Type: UnserializableContentError at /pkg/tob/rss
Exception Value: Control characters are not supported in XML 1.0
Loading
Please register or sign in to comment