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


Groups > comp.lang.python > #80806 > unrolled thread

Re: fileno() not supported in Python 3.1

Started byCameron Simpson <cs@zip.com.au>
First post2014-11-15 13:39 +1100
Last post2014-11-15 13:39 +1100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#80806 — Re: fileno() not supported in Python 3.1

FromCameron Simpson <cs@zip.com.au>
Date2014-11-15 13:39 +1100
SubjectRe: fileno() not supported in Python 3.1
Message-ID<mailman.15841.1416020967.18130.python-list@python.org>
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>

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web