IOError: [Errno 5] Input/output error

alvas picture alvas · Nov 7, 2014 · Viewed 15.9k times · Source

I have a sort of xml like file here: https://github.com/alvations/pywsd/blob/master/pywsd/data/semcor3.0_naf/brown1/br-e24.naf

And when I tried to read it as below, I got an IOError:

>>> import io
>>> infile = io.open('pywsd/data/semcor3.0_naf/brown1/br-e24.naf', 'r', encoding='utf8')
>>> infile.read()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 5] Input/output error

What does IOError: [Errono5] mean?

Has the error tell me that something is wrong in how I read the file or something wrong with the file?

How do I resolve the error?

Answer

Javier picture Javier · Nov 7, 2014

man errno says errno 5 is EIO: Input/output error (POSIX.1).

Pretty generic and the same you get in your exception.

This is as far as this can be explored from the information provided.