【发布时间】:2013-04-17 06:12:24
【问题描述】:
来自 Python 文档
异常 IOError
Raised when an I/O operation (such as a print statement, the built-in open() function or a method of a file object) fails for an I/O-related reason, e.g., “file not found” or “disk full”.
互联网上似乎没有列举原因。
IOErrors 似乎是放置 io 异常的地方,没有其他地方可以住。 我很好奇 IOErrors 的全部原因(至少是所有常见原因)。
让我们从访问类似文件的环境(具有文件概念的文件系统)的假设开始。 上面有有限的空间(一个 10 GB 的硬盘驱动器(磁性介质))。
这个问题不是特定于 python 的,真的,但我需要一个起点。
【问题讨论】:
-
只有一个问题。为什么需要它?
-
查看
raise IOError的python源码 -
谢谢大家,我去看看源码。
标签: python exception-handling io