python3 AttributeError: 'NoneType' object has no attribute 'split'
from wsgiref.simple_server import make_server def RunServer(environ, start_response):
start_response('200 ok',[('Content-Type','text/html')])
return '<h1>Hello world</h1>' if __name__ == '__main__':
httpd = make_server('127.0.0.1',9000,RunServer)
print('servering HTTP on port 9000')
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'的更多相关文章
- AttributeError: 'NoneType' object has no attribute 'split' 报错处理
报错场景 social_django 组件对原生 django 的支持较好, 但是因为 在此DRF进行的验证为 JWT 方式 和 django 的验证存在区别, 因此需要进行更改自行支持 JWT 方式 ...
- django' 前端 self.status.split(' ',1)[0], self.bytes_sent AttributeError: 'NoneType' object has no attribute 'split'
form 表单 post之后 ,重新定向当前页面的get请求 这是因为,form表单提交的时候,按钮在form表单里面
- python提示AttributeError: 'NoneType' object has no attribute 'append'【转发】
在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.appe ...
- python提示AttributeError: 'NoneType' object has no attribute 'append'
在写python脚本时遇到AttributeError: 'NoneType' object has no attribute 'append' a=[] b=[1,2,3,4] a = a.appe ...
- Keras AttributeError 'NoneType' object has no attribute '_inbound_nodes'
问题说明: 首先呢,报这个错误的代码是这行代码: model = Model(inputs=input, outputs=output) 报错: AttributeError 'NoneType' o ...
- pyspark AttributeError: 'NoneType' object has no attribute 'setCallSite'
pyspark: AttributeError: 'NoneType' object has no attribute 'setCallSite' 我草,是pyspark的bug.解决方法: prin ...
- AttributeError: 'NoneType' object has no attribute 'extend'
Python使用中可能遇到的小问题 AttributeError: 'NoneType' object has no attribute 'extend' 或者AttributeError: 'Non ...
- 解决opencv:AttributeError: 'NoneType' object has no attribute 'copy'
情况一: 路径中有中文,更改即可 情况二:可以运行代码,在运行结束时显示 AttributeError: 'NoneType' object has no attribute 'copy' 因为如果是 ...
- AttributeError: 'NoneType' object has no attribute 'bytes' python3.4 win64
解决方法: easy_install -U pip 详见: https://github.com/pypa/pip/issues/2669
随机推荐
- myBatis抛出异常Result Maps collection already contains value ...
BaseResultMap 是自动生成的,非说已经包含了,NM! 删除tomcat下的 D:\apache-tomcat-7.0.52\webapps\chp-approve\WEB-INF\clas ...
- linux Shell的使用
linux Shell的使用 下面是我对shell脚本使用的学习,写成日志,做个笔记,可以当做自己以后的复习. 1.输出hello world! vi test1.sh, 如果不会vi工具的使用,请参 ...
- systemd的原理和适用方法
systemd的原理: https://www.linux.com/learn/tutorials/527639-managing-services-on-linux-with-systemd htt ...
- AngularJs中的服务
一.angularJs中的简单服务应用 下面的例子让我们明白在AngularJs中如何去调用文件中的数据,从而将文件中的数据显示在页面上;改变url的地址,也可以去调用后台接口. 实例: <!D ...
- Visual Studio Professional 2015 (x86 and x64) - DVD (Chinese-Simplified)
文件名cn_visual_studio_professional_2015_x86_x64_dvd_6846645.isoSHA1629E7154E2695F08A3C692C0B3F6CE19DF6 ...
- Redis性能测试工具benchmark简介
Redis自己提供了一个性能测试工具redis-benchmark.redis-benchmark可以模拟N个机器,同时发送M个请求. 用法:redis-benchmark [-h -h <ho ...
- IntelliJ IDEA安装lombok插件
Settings→Plugins→Browse repositories 输入lom后选择Install Plugin 按照提示重启IDEA 来自为知笔记(Wiz)
- 黄聪:wp-setting.php文件详解
描述:用于设置公共变量.加载 WP 的程序和类库(存储 WP 函数.类和核心内容所在文件夹的位置).用户无需修改此文件,但是可以通过修改 wp-config.php 文件来进行配置. 定义 WPINC ...
- window.print实现打印特定控件或内容
window.print打印指定div 首先我们可以把要打印的内容放在div中,然后用下面的代码进行打印. <html> <head> <script language= ...
- 计算webView的 高度 和自适应屏幕大小
- (void)webViewDidFinishLoad:(UIWebView *)webView{ [webView stringByEvaluatingJavaScriptFromString: ...