A few questions come to mind in looking into this problem, and hopefully people here more knowledgeable about wsgi can help.
What does the start_response callable do? Does it output the header lines to stdout? Doesn't modwsgi itself provide the start_response callable? Does modwsgi's start_response do something more than the above? Is it possible for middleware to change the effect of start_response, to capture stdout and filter it? If middleware were to affect change by substituting an alternative start_response, what are the minimum requirements of a start_response to keep modwsgi happy? Thanks for any explanation or clarification you can offer. David On Sun, Nov 16, 2008 at 1:51 PM, David <[EMAIL PROTECTED]> wrote: > Now that I am looking at the correct headers, I am still having > difficulty finding the non-string object. > > The diagnostic code follows: This is the __call__ method of a > subclass of webob's Response class. > > . def __call__(self, environ, start_response): > . """ > . WSGI application interface > . """ > . print >> sys.stderr, 'HEADERS' > . for r, v in self.headerlist: > . print >> sys.stderr, type(r), repr(r), type(v), repr(v) > . print >> sys.stderr, 'status', self.status > . if self.conditional_response: > . return self.conditional_response_app(environ, start_response) > . start_response(self.status, self.headerlist) > . if environ['REQUEST_METHOD'] == 'HEAD': > . # Special case here... > . return [] > . return self.app_iter > > > The resulting loglines are: > > [Sun Nov 16 20:28:23 2008] [error] HEADERS > [Sun Nov 16 20:28:23 2008] [error] <type 'str'>'content-type'<type > 'str'>'text/html; charset=UTF-8' > [Sun Nov 16 20:28:23 2008] [error] <type 'str'>'Content-Length'<type > 'str'>'1792' > [Sun Nov 16 20:28:23 2008] [error] status200 OK > [Sun Nov 16 20:28:26 2008] [error] [client 12.23.82.153] mod_wsgi > (pid=14474): Exception occurred processing WSGI script > '/wsgi/mbr.wsgi'., referer: http://rdbhost.com/mbr/login > [Sun Nov 16 20:28:26 2008] [error] [client 12.23.82.153] TypeError: > expected string object for header value, referer: > http://rdbhost.com/mbr/login > > > It reports two header lines, and both name and value are string type > for each of the two header lines. > > Is there a way to induce modwsgi to put the actual header name in the > error message, or to have it stringify the nonstring values? > > David > -- [EMAIL PROTECTED] Pitcher's Duel -> pitchersduel.python-hosting.com --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "modwsgi" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/modwsgi?hl=en -~----------~----~----~----~------~----~------~--~---
