| 语言 | 格式 | 评分 |
|---|---|---|
英语 | .epub | 5 |
| 摘要 | ||
The document provides a detailed update log for Tornado 6.5, highlighting key changes, improvements, and deprecations. It includes updates to modules like tornado.ioloop, tornado.iostream, and tornado.netutil, with a focus on deprecating certain callback arguments and introducing new features. The document also notes compatibility changes, such as support for newer Python versions and improvements in error handling and security. Notable changes include the removal of deprecated modules, updates to type annotations, and enhancements in performance and functionality. | ||
| AI总结 | ||
### Tornado 6.5 文档总结
#### 主要更新和改进
1. **IOLoop 模块**
- `PeriodicCallback` 现在支持 `jitter` 参数,以随机变化超时时间。
- `IOLoop.set_blocking_signal_threshold`、`IOLoop.set_blocking_log_threshold`、`IOLoop.log_stack` 和 `IOLoop.handle_callback_exception` 已弃用,将在 6.0 版本中移除。
- 修复了多线程环境下 `IOLoop.close` 可能引发的 `KeyError` 问题。
2. **IOStream 模块**
- 所有回调参数(除 `BaseIOStream.set_close_callback` 外)已弃用,将在 6.0 版本中移除。
- `streaming_callback` 参数已弃用。
3. **Netutil 模块**
- 改善了与 GNU Hurd 的兼容性。
4. **Options 模块**
- `tornado.options.parse_config_file` 现在允许将选项设置为字符串,解析方式与命令行选项一致。
5. **Stack_context 模块**
- `tornado.stack_context` 模块已弃用,将在 6.0 版本中移除。
6. **Testing 模块**
- 提供了对异步网络、IOLoop、IOStream 和网络工具的测试支持。
7. **Auth 模块**
- `OAuthMixin.oauth_get_user` 方法已弃用,建议使用 `_oauth_get_user_future` 替代。
8. **Autoreload**
- 修复了 Windows 系统下与内部自定义重载结合使用时的进程重复启动问题。
9. **Python 版本支持**
- Tornado 6.0 及以上版本不再支持 Python 2.7 和 3.4,最低支持版本为 3.5.2。
- 新增对 Python 3.14 的支持(实验性)。
10. **安全改进**
- 处理畸形 `multipart-form-data` 请求时,现在会抛出异常而非多次警告,防止拒绝服务攻击(修复 CVE-2025-47287)。
11. **Type Annotation Changes**
- `tornado.concurrent.chain_future` 现在支持 asyncio 和 concurrent Futures。
- `tornado.gen.multi` 和 `multi_future` 现在接受 Sequence 和 Mapping 类型。
- `tornado.httputil.RequestStartLine` 和 `ResponseStartLine` 增加了类型注解。
12. **Bug Fixes**
- 修复了导入 Tornado 时因类型注解导致的错误。
- 修复了 `tornado.websocket` 中处理延续帧时的压缩问题。
13. **Deprecation Notices**
- 多个模块和接口(如 `tornado.stack_context` 和大部分回调参数)已弃用,建议迁移到基于协程的接口。
- 使用 `PYTHONWARNINGS=d` 或 `python -wd` 可以显示弃用警告,帮助应用准备迁移。
#### 核心功能模块
- **Coroutines and Concurrency**
- `tornado.gen` 提供生成器基的协程。
- `tornado.locks` 提供同步原语。
- `tornado.queues` 提供用于协程的队列。
- **Integration with Other Services**
- `tornado.auth` 提供 OpenID 和 OAuth 登录支持。
- `tornado.wsgi` 支持与其他 Python 框架和服务器的互操作性。
- `tornado.platform.twisted` 和 `tornado.platform.asyncio` 提供与 Twisted 和 asyncio 的桥梁。
- **Utilities**
- `tornado.autoreload` 提供自动代码重载检测。
- `tornado.concurrent` 提供对 Future 对象的支持。
- `tornado.log` 提供日志记录支持。
- `tornado.options` 提供命令行参数解析。
- `tornado.util` 提供通用工具类和函数。
#### 总结
Tornado 6.5 版本在性能、兼容性、安全性和开发者体验方面均有显著提升,重点包括对 Python 3.5+ 的全面支持、弃用回调接口、改进协程支持以及增强的安全性。建议开发者及时迁移至新版本,并关注弃用接口的替代方案以确保代码的长期维护性。 | ||
P1
P2
P3
P4
P5
P6
P7
P8
P9
P10
P11
P12
下载文档到本地,方便使用
- 可预览页数已用完,剩余
425 页请下载阅读 -
文档评分














Tornado 6.5 Documentation
Tornado 6.5 Documentation