Opened 8 years ago

Closed 8 years ago

#6126 closed (duplicate)

Django dies with FCGI

Reported by: ferretsrule <jorge+django_trac@…> Owned by: nobody
Component: Core (Other) Version: master
Severity: Keywords: FCGI, Error
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description

I'm not sure if this is to do with django, but I'm occasionally getting errors with fcgi like this:

<type 'exceptions.AssertionError'>	Python 2.5.1: /home/user/bin/python
Tue Dec 4 22:03:45 2007

A problem occurred in a Python script. Here is the sequence of function calls leading up to the error, in the order they occurred.
 /home/.putter/user/dj-g.net/fcgi.py in run(self=<fcgi.Request object at 0x40b2f98c>)
  578         """Runs the handler, flushes the streams, and ends the request."""
  579         try:
  580             protocolStatus, appStatus = self.server.handler(self)
  581         except:
  582             traceback.print_exc(file=self.stderr)
protocolStatus undefined, appStatus undefined, self = <fcgi.Request object at 0x40b2f98c>, self.server = <fcgi.WSGIServer object at 0x403f4f2c>, self.server.handler = <bound method WSGIServer.handler of <fcgi.WSGIServer object at 0x403f4f2c>>
 /home/.putter/user/dj-g.net/fcgi.py in handler(self=<fcgi.WSGIServer object at 0x403f4f2c>, req=<fcgi.Request object at 0x40b2f98c>)
 1268                     for data in result:
 1269                         if data:
 1270                             write(data)
 1271                     if not headers_sent:
 1272                         write('') # in case body was empty
write = <function write at 0x40c7ed84>, data = '\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...text/javascript"></script>\n</body>\n</html>\n\n'
 /home/.putter/user/dj-g.net/fcgi.py in write(data='\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...text/javascript"></script>\n</body>\n</html>\n\n')
 1210 
 1211         def write(data):
 1212             assert type(data) is str, 'write() argument must be string'
 1213             assert headers_set, 'write() before start_response()'
 1214 
builtin type = <type 'type'>, data = '\n<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...text/javascript"></script>\n</body>\n</html>\n\n', builtin str = <type 'str'>

Change History (2)

comment:1 Changed 8 years ago by voidfiles@…

  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

I am experiencing the same problems. I do not understand the whole thing but here is the fix I figured out.

if you look at the write function

1211 def write(data):
1212 assert type(data) is str, 'write() argument must be string'
1213 assert headers_set, 'write() before start_response()'

their is an assert type(data) is str

Well it seems as if their is something in their that can be printed out but this check doesn't considere it viable. when I disable this check, which I don't want to do, everything works fine.

If their is anymore I can contribute just let me know I am not sure where to go from here.

comment:2 Changed 8 years ago by Karen Tracey <kmtracey@…>

  • Resolution set to duplicate
  • Status changed from new to closed

This looks to be the same problem as #6063, something other than a str leaking out of HttpResponse. Try running with a checkout that includes r6895.

Note: See TracTickets for help on using tickets.
Back to Top