Path: csiph.com!usenet.pasdenom.info!dedibox.gegeweb.org!gegeweb.eu!nntpfeed.proxad.net!proxad.net!feeder1-2.proxad.net!news.tele.dk!news.tele.dk!small.news.tele.dk!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.015 X-Spam-Evidence: '*H*': 0.97; '*S*': 0.00; 'subject:not': 0.03; 'subject:Python': 0.06; 'sys': 0.07; 'cc:addr:python-list': 0.11; 'cc:name:python list': 0.16; 'workaround?': 0.16; 'wrote:': 0.18; 'thu,': 0.19; 'import': 0.22; 'cc:addr:python.org': 0.22; 'cc:2**0': 0.24; 'header:In-Reply-To:1': 0.27; 'message- id:@mail.gmail.com': 0.30; 'url:mailman': 0.30; '13,': 0.31; 'url:python': 0.33; 'received:google.com': 0.35; 'there': 0.35; 'url:listinfo': 0.36; 'url:org': 0.36; 'nov': 0.38; 'pm,': 0.38; 'little': 0.38; 'skip:p 20': 0.39; 'url:mail': 0.40; 'different': 0.65; 'to:addr:gmail.com': 0.65; 'skip:/ 30': 0.84 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type; bh=U0Me8+L6NaQyFOXZnvrWqRkZ57YkvPermKn/hmsawkA=; b=JQfoi+immBmXVWl/QQlZ61ORccpkx/nenFBvSh/EX676wHbWPskI8E/LU88v/B+lSD XP/hsM1rw4scMHqYgrQ8GoAFsV1xx7ltXl/SLHEejlMM+F6vkrOSZS5FURXDdiwUFsUH q8ICYixnxdDv7Oq1YOxl64E0lFHtzjx60AJnMDO9MOc0hhJbN7I+eXQIX7Mfl4ikpn7r fnEHyF53BR3ixOLyz50TwbWbFAaToa/uaCzQ+n4NfBdh/ITx1U2H61KefzXcAnu8MI4v HuRrApqyHrGgjRmGm+kg4s95X/jkz1PBrbozGYPFIXUfq3CBWPVZv1U84m1hYYAn+rz+ /qFA== MIME-Version: 1.0 X-Received: by 10.152.88.69 with SMTP id be5mr17699690lab.36.1416115546436; Sat, 15 Nov 2014 21:25:46 -0800 (PST) In-Reply-To: References: Date: Sat, 15 Nov 2014 21:25:46 -0800 Subject: Re: fileno() not supported in Python 3.1 From: Dan Stromberg To: satishmlmlml@gmail.com Content-Type: text/plain; charset=UTF-8 Cc: Python List 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: 28 NNTP-Posting-Host: 2001:888:2000:d::a6 X-Trace: 1416115554 news.xs4all.nl 2829 [2001:888:2000:d::a6]:56052 X-Complaints-To: abuse@xs4all.nl Xref: csiph.com comp.lang.python:80854 On Thu, Nov 13, 2014 at 3:48 PM, wrote: > import sys > for stream in (sys.stdin, sys.stdout, sys.stderr): > print(stream.fileno()) > > > io.UnsupportedOperation: fileno > > Is there a workaround? > -- > https://mail.python.org/mailman/listinfo/python-list Works for me, although it's a little different in Jython: $ pythons --command 'import sys; print(sys.stdin.fileno())' /usr/local/cpython-2.4/bin/python good 0 /usr/local/cpython-2.5/bin/python good 0 /usr/local/cpython-2.6/bin/python good 0 /usr/local/cpython-2.7/bin/python good 0 /usr/local/cpython-3.0/bin/python good 0 /usr/local/cpython-3.1/bin/python good 0 /usr/local/cpython-3.2/bin/python good 0 /usr/local/cpython-3.3/bin/python good 0 /usr/local/cpython-3.4/bin/python good 0 /usr/local/jython-2.7b3/bin/jython good org.python.core.io.StreamIO@170ed6ab /usr/local/pypy-2.3.1/bin/pypy good 0 /usr/local/pypy-2.4.0/bin/pypy good 0 /usr/local/pypy3-2.3.1/bin/pypy good 0 /usr/local/pypy3-2.4.0/bin/pypy good 0