fileno() not supported in Python 3.1

Dan Stromberg drsalists at gmail.com
Sun Nov 16 00:25:46 EST 2014


On Thu, Nov 13, 2014 at 3:48 PM,  <satishmlmlml at gmail.com> 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 at 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



More information about the Python-list mailing list