Ticket #4 (assigned defect)

Opened 8 months ago

Last modified 1 month ago

Cannot run Amplee as WSGI application because 4Suite_XML requires stdout

Reported by: guest Assigned to: sylvain (accepted)
Priority: minor Milestone:
Component: amplee Version: amplee-0.6.0
Keywords: Cc: nikunj@tookri.com

Description

The following trace shows what happens when amplee starts up and stdout is restricted by mod_wsgi in Apache. If I put WSGIRestrictStdout off then this error goes away

[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1] mod_wsgi (pid=13056): Exception occurred processing WSGI script '/usr/local/amplee.wsgi'.
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1] Traceback (most recent call last):
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/usr/local/amplee.wsgi", line 9, in <module>
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     from amplee.atompub.collection import FeedHandler
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/amplee-0.6.0-py2.5.egg/amplee/atompub/collection.py", line 32, in <module>
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     import amara
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Amara-1.2.0.2-py2.5.egg/amara/__init__.py", line 11, in <module>
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/Amara-1.2.0.2-py2.5.egg/amara/binderytools.py", line 13, in <module>
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/InputSource.py", line 355, in <module>
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     DefaultFactory = InputSourceFactory(catalog=GetDefaultCatalog())
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/Catalog.py", line 575, in GetDefaultCatalog
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     catalog = Catalog(uri, quiet)
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/Catalog.py", line 95, in __init__
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     self._parseXmlCat(data)
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/Catalog.py", line 372, in _parseXmlCat
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     from Ft.Xml.Sax import CreateParser
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/Sax.py", line 242, in <module>
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     class SaxPrinter(ContentHandler):
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/Sax.py", line 247, in SaxPrinter
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     def __init__(self, printer=XmlPrinter(sys.stdout, 'utf-8')):
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]   File "/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages/4Suite_XML-1.0.2-py2.5-macosx-10.3-i386.egg/Ft/Xml/Lib/XmlPrinter.py", line 39, in __init__
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1]     self.stream = sw = cStreamWriter.StreamWriter(stream, encoding)
[Sun Apr 06 08:15:38 2008] [error] [client 127.0.0.1] TypeError: argument must have 'write' attribute

Change History

04/17/08 02:48:53 changed by sylvain

  • status changed from new to assigned.

I'm not sure exactly what mod_wsgi does internally when that flag is on but from the error it apperas that it would convert all unicode strings to byte strings which is a no-no for Amara that expects unicode only (except on its parse function).

04/17/08 03:08:20 changed by sylvain

Oh right. I have misread that ticket entirely.

That's is an interesting issue but I believe it ought to be brought up to the 4Suite mailing-list instead.

05/07/08 09:59:46 changed by sylvain

  • version changed from Current to amplee-0.6.0.

10/20/08 14:58:15 changed by sylvain

  • priority changed from major to minor.