RosesDurden / pysimplesoap

Automatically exported from code.google.com/p/pysimplesoap
0 stars 0 forks source link

"TypeError: expected byte string object for status, value of type unicode found" when using wsgi #107

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Use current hq version of pysimplesoap
2. Use WSGISOAPHandler with mod_wsgi2 3.4 in apache 2.2.25

What is the expected output? What do you see instead?

I get an error when just using WSGISOAPHandler with mod_wsgi:

Traceback (most recent call last):
  File "/home/[..]/.virtualenvs/[..]/lib/python2.7/site-packages/pysimplesoap/server.py", line 448, in __call__
    return self.handler(environ, start_response)
  File "/home/[..]/.virtualenvs/[..]/lib/python2.7/site-packages/pysimplesoap/server.py", line 452, in handler
    return self.do_get(environ, start_response)
  File "/home/[..]/.virtualenvs/[..]/lib/python2.7/site-packages/pysimplesoap/server.py", line 475, in do_get
    start_response('200 OK', [('Content-Type', 'text/xml'), ('Content-Length', str(len(response)))])
TypeError: expected byte string object for status, value of type unicode found

It works if I put str() around all the strings involved on that line, so it 
becomes:

start_response(str('200 OK'), [(str('Content-Type'), str('text/xml')), 
(str('Content-Length'), str(len(response)))])

But I'm really not sure if that's a good way to handle this.

What version of the product are you using? On what operating system?

OS: Arch Linux
Python: 2.7.5
Virtualenv: 1.9.1

Original issue reported on code.google.com by heineman...@gmail.com on 25 Jul 2013 at 3:09