[Yum-devel] [PATCH] Use os.open instead of open

James Antill james at fedoraproject.org
Thu Sep 29 13:19:13 UTC 2011


On Thu, 2011-09-29 at 09:14 +0200, Zdeněk Pavlas wrote:
> Builtin open() function works only with files.
> We should start reading logger.critical messages.
> 
> >>> os.open('.', os.O_RDONLY)
> 3
> >>> open('.')
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> IOError: [Errno 21] Is a directory: '.'

 Amusingly it does work though, because the error is correct:

In [1]: open(".")
IOError: [Errno 21] Is a directory: '.'

In [2]: open("/root")
IOError: [Errno 13] Permission denied: '/root'



More information about the Yum-devel mailing list