python - newbody = ntob('').join(newbody) TypeError: sequence item 1: expected string, int found -


what best way troubleshoot error? typeerror: sequence item 1: expected string, int found

the python file (not mentioned in traceback) 500 lines.

request headers:   cookie: admin_sess=c13d2f729d47c132b223e8f19ce77ac25aa12   origin: https://192.168.1.135:5001   remote-addr: 192.168.1.161   content-length: 36   user-agent: mozilla/5.0 (x11; linux x86_64) applewebkit/537.36 (khtml, gecko) ubuntu chromium/43.0.2357.81 chrome/43.0.2357.81 safari/537.36   connection: keep-alive   referer: https://192.168.1.135:5001/   x-requested-with: xmlhttprequest   host: 192.168.1.135:5001   accept: */*   accept-language: en-us,en;q=0.8   content-type: application/x-www-form-urlencoded; charset=utf-8   accept-encoding: gzip, deflate [18/jun/2015:18:10:15] http traceback (most recent call last):   file "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 661, in respond     response.finalize()   file "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 927, in finalize     content = self.collapse_body()   file "/usr/lib/python2.7/site-packages/cherrypy/_cprequest.py", line 894, in collapse_body     newbody = ntob('').join(newbody) typeerror: sequence item 1: expected string, int found 

the str.join function expects sequence of string, @ least 1 item in newbody int. try cast them string first:

newbody = ntob('').join(map(str, newbody)) 

Comments

Popular posts from this blog

PHP DOM loadHTML() method unusual warning -

python - How to create jsonb index using GIN on SQLAlchemy? -

c# - TransactionScope not rolling back although no complete() is called -