Question

I have a program written in Python 2.7.5 that I waned to move to my account hosted on WebFaction. There I wanted to implement it using Pyramid 1.4/Python 2.7. I have installed all packages, but it seems I have a problem with Pyramid itself. Below the list of packages I use is the error I get.

md5, sys, os, tempfile, json, re, urllib2, time, multiprocessing requests

2013-10-18 21:37:48,821 ERROR [waitress][Dummy-1] Exception when serving /
Traceback (most recent call last):
  File "/home/.../lib/python2.7/waitress/channel.py", line 329, in service
    task.service()
  File "/home/.../lib/python2.7/waitress/task.py", line 173, in service
    self.execute()
  File "/home/.../lib/python2.7/waitress/task.py", line 412, in execute
    self.write(chunk)
  File "/home/.../lib/python2.7/waitress/task.py", line 303, in write
    channel.write_soon(towrite)
  File "/home/.../lib/python2.7/waitress/channel.py", line 311, in write_soon
    self.outbufs[-1].append(data)
  File "/home/.../lib/python2.7/waitress/buffers.py", line 243, in append
    self.strbuf = strbuf + s
TypeError: cannot concatenate 'str' and 'list' objects

Any suggestions how to debug this?

Was it helpful?

Solution

The solution was simple, but not that obvious. In the view.py I had a view which was returning

Response(x)

where x was the output from my multiprocess code, but it is also a list. That caused a problem. Finally I went to use render_to_response and passsed the result as a part of a dictionary

return render_to_response('main.mak', {'results':x})
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top