[New-bugs-announce] [issue21090] File read silently stops after EIO I/O error
ivank
report at bugs.python.org
Fri Mar 28 23:29:46 CET 2014
New submission from ivank:
I intentionally corrupted a zpool to induce an I/O error in a file, in this case, /usr/lib/x86_64-linux-gnu/gconv/IBM1390.so
# ls -l /usr/lib/x86_64-linux-gnu/gconv/IBM1390.so
-rw-r--r-- 1 root root 231,496 2014-03-24 06:26 /usr/lib/x86_64-linux-gnu/gconv/IBM1390.so
# cat /usr/lib/x86_64-linux-gnu/gconv/IBM1390.so > /dev/null
cat: /usr/lib/x86_64-linux-gnu/gconv/IBM1390.so: Input/output error
When I read the file, Python 3.3.5 and 3.4.0 check for EIO and raise an exception:
>>> open("/usr/lib/x86_64-linux-gnu/gconv/IBM1390.so", "rb").read()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OSError: [Errno 5] Input/output error
but Python 2.7.6 does not:
# python2
Python 2.7.6 (default, Mar 22 2014, 22:59:56)
[GCC 4.8.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> x = open("/usr/lib/x86_64-linux-gnu/gconv/IBM1390.so", "rb").read()
>>> len(x)
131072
----------
components: IO
messages: 215085
nosy: ivank
priority: normal
severity: normal
status: open
title: File read silently stops after EIO I/O error
versions: Python 2.7
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue21090>
_______________________________________
More information about the New-bugs-announce
mailing list