python3 AttributeError: 'NoneType' object has no attribute 'split'

Posted 安迪_963

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了python3 AttributeError: 'NoneType' object has no attribute 'split'相关的知识,希望对你有一定的参考价值。

技术分享
 1 from wsgiref.simple_server import make_server
 2  
 3 def RunServer(environ, start_response):
 4     start_response(200 ok,[(Content-Type,text/html)])
 5     return <h1>Hello world</h1>
 6 
 7 if __name__ == __main__:
 8     httpd = make_server(127.0.0.1,9000,RunServer)
 9     print(servering HTTP on port 9000)
10     httpd.serve_forever()
Code

运行时报错:

self.status.split(‘ ‘,1)[0], self.bytes_sent
AttributeError: ‘NoneType‘ object has no attribute ‘split‘

 

解决办法如下:

return [‘<h1>Hello world</h1>‘.encode(‘utf-8‘),]

 

以上是关于python3 AttributeError: 'NoneType' object has no attribute 'split'的主要内容,如果未能解决你的问题,请参考以下文章

[Bug]Python3.x AttributeError: libtest.so: undefined symbol: fact

python3 AttributeError: 'NoneType' object has no attribute 'split'

Python 3.6 AttributeError:模块“statsmodels”没有属性“compat”

python3 AttributeError: module 'urllib' has no attribute 'urlencode'

python reload(sys)找不到,name 'reload' is not defined和Python3异常-AttributeError: module 'sys

AttributeError:模块“张量流”没有属性“会话”