Path: csiph.com!usenet.pasdenom.info!news.etla.org!news.stack.nl!newsfeed.xs4all.nl!newsfeed4a.news.xs4all.nl!xs4all!newsgate.cistron.nl!newsgate.news.xs4all.nl!post.news.xs4all.nl!not-for-mail Return-Path: X-Original-To: python-list@python.org Delivered-To: python-list@mail.python.org X-Spam-Status: OK 0.003 X-Spam-Evidence: '*H*': 0.99; '*S*': 0.00; 'python.': 0.02; 'subject:not': 0.03; 'subject:Python': 0.06; 'sys': 0.07; 'ide': 0.09; 'yeah,': 0.09; 'python': 0.11; '>on': 0.16; 'from:addr:cs': 0.16; 'from:addr:zip.com.au': 0.16; 'from:name:cameron simpson': 0.16; 'message-id:@cskk.homeip.net': 0.16; 'op.': 0.16; 'received:211.29': 0.16; 'received:211.29.132': 0.16; 'received:cskk.homeip.net': 0.16; 'received:homeip.net': 0.16; 'received:optusnet.com.au': 0.16; 'received:syd.optusnet.com.au': 0.16; 'simpson': 0.16; 'workaround?': 0.16; 'wrote:': 0.18; '>>>': 0.22; 'import': 0.22; 'header:User-Agent:1': 0.23; 'connected': 0.24; 'fine': 0.24; 'cheers,': 0.24; 'file.': 0.24; "i've": 0.25; 'signed': 0.27; 'header:In-Reply-To:1': 0.27; 'am,': 0.29; 'thus': 0.29; "skip:' 10": 0.31; 'workaround': 0.31; 'fri,': 0.33; 'display': 0.35; 'but': 0.35; 'there': 0.35; 'version': 0.36; '14,': 0.36; 'received:com.au': 0.36; 'charset:us-ascii': 0.36; 'nov': 0.38; 'received:211': 0.38; 'to:addr:python-list': 0.38; 'anything': 0.39; 'itself': 0.39; 'obtain': 0.39; 'to:addr:python.org': 0.39; 'skip:p 20': 0.39; 'ian': 0.60; 'first': 0.61; 'content-disposition:inline': 0.62; 'email addr:gmail.com': 0.63; 'information': 0.63; 'kind': 0.63; 'real': 0.63; 'more': 0.64; 'mar': 0.68; '"just': 0.84; '2014,': 0.84; 'streams': 0.84; 'facility,': 0.91 Date: Sat, 15 Nov 2014 13:39:58 +1100 From: Cameron Simpson To: Python Subject: Re: fileno() not supported in Python 3.1 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) References: X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.1 cv=fvDlOjIf c=1 sm=1 tr=0 a=YuQlxtEQCowy2cfE5kc7TA==:117 a=YuQlxtEQCowy2cfE5kc7TA==:17 a=ZtCCktOnAAAA:8 a=PO7r1zJSAAAA:8 a=J0QyKEt1u0cA:10 a=kj9zAlcOel0A:10 a=vrnE16BAAAAA:8 a=pGLkceISAAAA:8 a=QrVWhbZvAAAA:8 a=RaqY0PCMlyZ591bSuBgA:9 a=CjuIK1q_8ugA:10 X-BeenThere: python-list@python.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: General discussion list for the Python programming language List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Newsgroups: comp.lang.python Message-ID: Lines: 32 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416020966 news.xs4all.nl 2884 [2001:888:2000:d::a6]:36057 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80806 On 14Nov2014 09:51, Ian Kelly wrote: >On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson wrote: >> On 13Nov2014 15:48, 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 That's about as good as when one of my students left me a note signed 'anon.'--written on personalized stationery. - Ayse Sercan