Ben NanoNote

Sign in or create your account | Project List | Help

Issue 97: Wrong error code when it is tried to open for reading a non existent file

Reported by Juan ComesaƱa, Oct 22, 2010

Hi,

The C function open produces a wrong error code when it is used for 
reading a non existent file. According to the man page the right 
error code for this case is ENOENT.

This bug was observed in the software image 2010-09-14.

I've attached a C file with code that allows to reproduce the bug. 

Another way is of reproducing the bug with with Python:

f = open('foo.txt', 'r')

You will get the following error message:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 6042416] Unknown error 6042416: 'foo.txt'

Instead of the expected one:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
IOError: [Errno 2] No such file or directory: 'foo.txt

Created: 8 years 6 months ago by Juan ComesaƱa

Status: New

Labels:
Type:Defect
Priority:Medium



interactive