[pypy-dev] should os.fdopen(fd-of-a-directory, "r") succeed?

Alex Gaynor alex.gaynor at gmail.com
Wed Apr 9 20:32:55 CEST 2014


It fails under CPython 2.7 as well, I guess we should fix it.

Alex


On Wed, Apr 9, 2014 at 2:29 PM, Dima Tisnek <dimaqq at gmail.com> wrote:

> it fails on py 2.7 (with a bug), fails correctly in py 3.3 and
> succeeds in pypy 2.2:
>
> >>>> import os
> >>>> os.open("/", os.O_RDONLY)
> 3
> >>>> os.fdopen(3, "r")
> <open file '<fdopen>', mode 'r' at 0x0000000105b71830>
> >>>> f = _
> >>>> f.read(1)
> Traceback (most recent call last):
>   File "<stdin>", line 1, in <module>
> IOError: [Errno 21] Is a directory: '<fdopen>'
> >>>>
> _______________________________________________
> pypy-dev mailing list
> pypy-dev at python.org
> https://mail.python.org/mailman/listinfo/pypy-dev
>



-- 
"I disapprove of what you say, but I will defend to the death your right to
say it." -- Evelyn Beatrice Hall (summarizing Voltaire)
"The people's good is the highest law." -- Cicero
GPG Key fingerprint: 125F 5C67 DFE9 4084
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20140409/c49f6f92/attachment.html>


More information about the pypy-dev mailing list