zope.publisher-3.4.0b1_r76188-py2.4 egg causes server error.

Bug #122054 reported by Darryl Cousins on 2007-06-25
Affects Status Importance Assigned to Milestone
Zope 3

Bug Description

My buildout update the zope.publisher egg to
zope.publisher-3.4.0b1_r76188-py2.4 from
zope.publisher-3.4.0a1_1-py2.4.egg. My application is served with paste
and I have pasted the traceback below.

The change between 3.4.0a1 and 3.4.0b1 that causes a server error is in
class HTTPInputStream in file http.py where an additional check for
content size from environment['CONTENT_LENGTH'] has been added. This
returns an empty string rather than None (as returned from
environment['HTTP_CONTENT_LENGTH']. To correct for this the following
works where my addition is to check also for empty string:

    def __init__(self, stream, environment):
        self.stream = stream
        size = environment.get('CONTENT_LENGTH')
        if size is None or size == '': # my change to correct error
            size = environment.get('HTTP_CONTENT_LENGTH')
        if size is None or int(size) < 65536:
            self.cacheStream = StringIO()
            self.cacheStream = TemporaryFile()


ERROR:root:Traceback (most recent call last):
line 126, in runWSGIApp
"/usr/lib/python2.4/site-packages/Paste-1.3-py2.4.egg/paste/translogger.py", line 67, in __call__
    return self.application(environ, replacement_start_response)
line 202, in __call__
    return app(environ, start_response)
  File "/opt/tfws/deliverance/deliverance/wsgimiddleware.py", line 177,
in __call__
    status, headers, body = self.rebuild_check(environ, start_response)
  File "/opt/tfws/deliverance/deliverance/wsgimiddleware.py", line 242,
in rebuild_check
line 539, in intercept_output
    app_iter = application(environ, replacement_start_response)
"/opt/buildout/eggs/tmprEEpqW/zope.app.wsgi-3.4.0b1dev_r75415-py2.4.egg/zope/app/wsgi/__init__.py", line 49, in __call__
"/opt/buildout/eggs/tmpEro0qX/zope.app.publication-3.4.0a1_2-py2.4.egg/zope/app/publication/httpfactory.py", line 69, in __call__
"/opt/buildout/eggs/tmpSsJyAK/zope.publisher-3.4.0b1_r76188-py2.4.egg/zope/publisher/browser.py", line 233, in __init__
"/opt/buildout/eggs/tmpSsJyAK/zope.publisher-3.4.0b1_r76188-py2.4.egg/zope/publisher/http.py", line 298, in __init__
"/opt/buildout/eggs/tmpSsJyAK/zope.publisher-3.4.0b1_r76188-py2.4.egg/zope/publisher/http.py", line 197, in __init__
ValueError: invalid literal for int():

I committed a fix in r77464 and released a zope.publisher 3.4.0b2 egg subsequently to http://download.zope.org/distribution

Changed in zope3:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers