AttributeError: 'StatusHandler' object has no attribute 'async_callback'
完整报错如下:
(Python3.6) appleyuchi@ubuntu19:5.2-使用Tornado进行长轮询$ python shopping_cart.py
[I 200409 20:55:43 web:2162] 200 GET / (::1) 1.99ms
[I 200409 20:55:43 web:2162] 200 GET /static/images/internet.jpg (::1) 3.80ms
[I 200409 20:55:43 web:2162] 200 GET /static/scripts/inventory.js?v=081e5ab58d037c4cc17adb713e0b601b (::1) 0.66ms
[E 200409 20:55:43 web:1670] Uncaught exception GET /cart/status?session=a59525ab-ef55-4f2d-989a-90baea6d6578 (::1)
HTTPServerRequest(protocol='http', host='localhost:8000', method='GET', uri='/cart/status?session=a59525ab-ef55-4f2d-989a-90baea6d6578', version='HTTP/1.1', remote_ip='::1')
Traceback (most recent call last):
File "/home/appleyuchi/anaconda3/envs/Python3.6/lib/python3.6/site-packages/tornado/web.py", line 1548, in _stack_context_handle_exception
raise_exc_info((type, value, traceback))
File "<string>", line 4, in raise_exc_info
File "/home/appleyuchi/anaconda3/envs/Python3.6/lib/python3.6/site-packages/tornado/web.py", line 1756, in wrapper
result = method(self, *args, **kwargs)
File "shopping_cart.py", line 64, in get
self.application.shoppingCart.register(self.async_callback(self.on_message))
AttributeError: 'StatusHandler' object has no attribute 'async_callback'
故障原因:
代码一般出自Tornado2.x
解决方案:
self.application.shoppingCart.register(self.async_callback(self.on_message))
改成:
self.application.shoppingCart.register(callback=self.on_message)
AttributeError: 'StatusHandler' object has no attribute 'async_callback'相关推荐
- Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法
今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...
- AttributeError: 'dict' object has no attribute 'status_code'
前端AJAX请求数据,提示错误:"AttributeError: 'dict' object has no attribute 'status_code'". 原因:是提示返回对象 ...
- Traceback (most recent call last): File AttributeError: 'NoneType' object has no attribute 'group'
Traceback (most recent call last):File "<stdin>", line 1, in <module> Attribut ...
- 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘
解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...
- AttributeError: ‘FPDF‘ object has no attribute ‘unifontsubset‘
AttributeError: 'FPDF' object has no attribute 'unifontsubset' 目录 AttributeError: 'FPDF' object has ...
- AttributeError: ‘Series‘ object has no attribute ‘as_matrix‘
AttributeError: 'Series' object has no attribute 'as_matrix' 问题: y_test = test_shifted["y_t+1&q ...
- AttributeError: ‘SVC‘ object has no attribute ‘_probA‘
AttributeError: 'SVC' object has no attribute '_probA' 问题: # Save the Modle to file in the current w ...
- sklearn使用FeatureHasher处理字符串特征: AttributeError: ‘str‘ object has no attribute ‘items‘
sklearn使用FeatureHasher处理字符串特征: AttributeError: 'str' object has no attribute 'items' 目录 sklearn使用Fea ...
- Keras问题“AttributeError: 'NoneType' object has no attribute 'update”解决
BUG 在使用Keras训练模型时,在每个epoch完成后save_model时会报错 "AttributeError: 'NoneType' object has no attribute ...
最新文章
- 分享:个人是怎么学习新知识的
- 20多岁大专生吐槽:面试39岁同济大学毕业的测试专家,对方却连简单编程题都不会!...
- java多线程-死锁的一些问题
- springboot启动后controller访问404
- windows下安装Oracle10G
- Web前端开发笔记——第四章 JavaScript程序设计 第五节 数组
- HBase1.0.0 实现数据增删查
- Selenium备忘手册 [转]
- xshell十大技巧
- jmeter+Fiddler:通过Fiddler抓包生成jmeter脚本
- 边缘计算助力云游戏成为5G时代的杀手级应用
- Struts2前身Struts1是如何转起来的呢
- ASP Session的功能的缺陷以及解决方案
- iOS 设计模式浅析 0 - 前言
- java重载静态方法_java – 使用静态和非静态方法重载的方法
- swift1.2新增和改动
- Web安全实践(11)用户名枚举
- 文件无法复制到c盘的解决办法
- apollo 横纵向控制改成MPC控制方式
- 魔兽争霸——《冰封王座》2007魔兽比赛背景音乐下载