完整报错如下:

(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'相关推荐

  1. Python错误:AttributeError: 'generator' object has no attribute 'next'解决办法

    今天在学习生成器对象(generation object)运行以下代码时,遇到了一个错误: #定义生成器函数 def liebiao(): for x in range(10): yield x #函 ...

  2. AttributeError: 'dict' object has no attribute 'status_code'

    前端AJAX请求数据,提示错误:"AttributeError: 'dict' object has no attribute 'status_code'". 原因:是提示返回对象 ...

  3. 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 ...

  4. 解决:AttributeError: ‘Graph‘ object has no attribute ‘number_of_selfloops‘

    解决:AttributeError: 'Graph' object has no attribute 'number_of_selfloops' 目录 解决:AttributeError: 'Grap ...

  5. AttributeError: ‘FPDF‘ object has no attribute ‘unifontsubset‘

    AttributeError: 'FPDF' object has no attribute 'unifontsubset' 目录 AttributeError: 'FPDF' object has ...

  6. AttributeError: ‘Series‘ object has no attribute ‘as_matrix‘

    AttributeError: 'Series' object has no attribute 'as_matrix' 问题: y_test = test_shifted["y_t+1&q ...

  7. AttributeError: ‘SVC‘ object has no attribute ‘_probA‘

    AttributeError: 'SVC' object has no attribute '_probA' 问题: # Save the Modle to file in the current w ...

  8. sklearn使用FeatureHasher处理字符串特征: AttributeError: ‘str‘ object has no attribute ‘items‘

    sklearn使用FeatureHasher处理字符串特征: AttributeError: 'str' object has no attribute 'items' 目录 sklearn使用Fea ...

  9. Keras问题“AttributeError: 'NoneType' object has no attribute 'update”解决

    BUG 在使用Keras训练模型时,在每个epoch完成后save_model时会报错 "AttributeError: 'NoneType' object has no attribute ...

最新文章

  1. 分享:个人是怎么学习新知识的
  2. 20多岁大专生吐槽:面试39岁同济大学毕业的测试专家,对方却连简单编程题都不会!...
  3. java多线程-死锁的一些问题
  4. springboot启动后controller访问404
  5. windows下安装Oracle10G
  6. Web前端开发笔记——第四章 JavaScript程序设计 第五节 数组
  7. HBase1.0.0 实现数据增删查
  8. Selenium备忘手册 [转]
  9. xshell十大技巧
  10. jmeter+Fiddler:通过Fiddler抓包生成jmeter脚本
  11. 边缘计算助力云游戏成为5G时代的杀手级应用
  12. Struts2前身Struts1是如何转起来的呢
  13. ASP Session的功能的缺陷以及解决方案
  14. iOS 设计模式浅析 0 - 前言
  15. java重载静态方法_java – 使用静态和非静态方法重载的方法
  16. swift1.2新增和改动
  17. Web安全实践(11)用户名枚举
  18. 文件无法复制到c盘的解决办法
  19. apollo 横纵向控制改成MPC控制方式
  20. 魔兽争霸——《冰封王座》2007魔兽比赛背景音乐下载

热门文章

  1. [算法天天练] 归并排序
  2. 正在进行时 Order 1
  3. CVE-2017-7921复现(解密文件)
  4. Element Select下拉框 选中后视图没有渲染等问题
  5. host文件知识详解
  6. ISO时间转化时间戳
  7. pythonwhile循环实战教程_Python入门丨for循环和while循环
  8. JavaScript ES 5 语法 重构 new
  9. vue父组件使用子组件函数,vue子组件使用父组件函数
  10. 实现一个MVVM和promise