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
随机推荐
- BeanUtils.copyProperties() 用法--部分转
把一个类对象copy到另一个类对象(这两个可以不同). 1.org.apache.commons.beanutils.BeanUtils.copyProperties(dest, src) org.s ...
- Quartz CronTrigger最完整配置说明
转:http://www.blogjava.net/xmatthew/archive/2009/02/15/253864.html Quartz CronTrigger最完整配置说明 CronTr ...
- Linux环境下MySQL使用入门
1 安装 1.1 yum安装 yum install mysql-server yum remove mysql service mysqld restart // 服务重新启动 chkconfig ...
- 无需添加引用执行JS,发布无需带DLL、例子:QQMD5 QQGTK 13位时间戳 取随机数
javascriptDemo.rar 本人写POST经常会遇到用JS来加密的一些网站,然后又不想用C#重写.在百度和论坛里找的JS执行不是64位不支持就是要带个DLL神马的.很讨厌.然后自己就写了个不 ...
- JSP的Servlet监听器
JSP的Servlet监听器 来源: http://blog.csdn.net/phoenix_17th/article/details/3868670 Servlet 监听器用于监听一些重要事件的发 ...
- erlang实现ssh
借鉴自http://blog.csdn.net/the__one/article/details/6567443和http://blog.yufeng.info/archives/1509 单命令启动 ...
- 拖拽碰撞--原声js(自身理解上新的方法)
<!doctype html> <html> <head> <meta charset="utf-8"> <title> ...
- 一次非常有意思的 SQL 优化经历
我用的数据库是mysql5.6,下面简单的介绍下场景 课程表 create table Course( c_id int PRIMARY KEY, name varchar(10) ) 数据100条 ...
- PLSQL_闪回删除FlashBack Delete表误删除如何进行恢复(案例)
2014-07-02 Created By BaoXinjian
- POJ 1743 Musical Theme (后缀数组,求最长不重叠重复子串)(转)
永恒的大牛,kuangbin,膜拜一下,Orz 链接:http://www.cnblogs.com/kuangbin/archive/2013/04/23/3039313.html Musical T ...