Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80806

Re: fileno() not supported in Python 3.1

Date 2014-11-15 13:39 +1100
From Cameron Simpson <cs@zip.com.au>
Subject Re: fileno() not supported in Python 3.1
References <CALwzid=s7cAo6iA1yUtt4wygTLhg2rXKr6xFDrP+V7Ekjnog_g@mail.gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.15841.1416020967.18130.python-list@python.org> (permalink)

Show all headers | View raw


On 14Nov2014 09:51, Ian Kelly <ian.g.kelly@gmail.com> wrote:
>On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson <cs@zip.com.au> wrote:
>> On 13Nov2014 15:48, satishmlmlml@gmail.com <satishmlmlml@gmail.com> wrote:
>>> import sys
>>> for stream in (sys.stdin, sys.stdout, sys.stderr):
>>>           print(stream.fileno())
>>> io.UnsupportedOperation: fileno
>>>
>>> Is there a workaround?
>>
>> The first workaround that suggests itself it to use a more modern Python.
>> I've got 3.4.2 here, and it goes: [... works just fine ...]
>
>Why do you think the Python version has anything to do with it?
>Python 2.7.6 (default, Mar 22 2014, 22:59:56) [... works just fine ...]
>Clearly, in 2.7.6 it also "just works".

Yeah, true.

I think the consensus is now that the OP is using some kind of IDE where the IO 
streams are not connected to terminals or other real OS-level files, but to 
stream abstractions delivering the the IDE display widgetry. Thus no .fileno() 
facility, because there is no OS-level file.

But we have yet to obtain that information from the OP.

Cheers,
Cameron Simpson <cs@zip.com.au>

That's about as good as when one of my students left me a note signed
'anon.'--written on personalized stationery.
        - Ayse Sercan <ayse@netcom.com>

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: fileno() not supported in Python 3.1 Cameron Simpson <cs@zip.com.au> - 2014-11-15 13:39 +1100

csiph-web