原因:测试用例对于python2.x 和 python3.x的写法不同。
python2.x请用一下用例测试:
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return "Hello World"
python3.x请用一下用例测试:
def application(env, start_response):
start_response('200 OK', [('Content-Type','text/html')])
return [b"Hello World"]
本文提供了Python2.x和Python3.x环境下WSGI应用的基本示例,帮助开发者理解不同版本间返回类型的区别。在Python2.x中,返回值为字符串;而在Python3.x中,返回值则为字节串。
9021





