Re: fileno() not supported in Python 3.1

2014-11-15 Thread Chris Angelico
On Sun, Nov 16, 2014 at 4:25 PM, Dan Stromberg wrote: > Works for me, although it's a little different in Jython: > $ pythons --command 'import sys; print(sys.stdin.fileno())' > /usr/local/jython-2.7b3/bin/jython good org.python.core.io.StreamIO@170ed6ab Huh, that is curious. According to its CPy

Re: fileno() not supported in Python 3.1

2014-11-15 Thread Dan Stromberg
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

Re: fileno() not supported in Python 3.1

2014-11-15 Thread Steven D'Aprano
Ian Kelly wrote: > On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson wrote: >> On 13Nov2014 15:48, satishmlm...@gmail.com >> wrote: >>> >>> import sys >>> for stream in (sys.stdin, sys.stdout, sys.stderr): >>> print(stream.fileno()) >>> >>> >>> io.UnsupportedOperation: fileno >>> >>> I

Re: fileno() not supported in Python 3.1

2014-11-14 Thread Cameron Simpson
On 14Nov2014 09:51, Ian Kelly wrote: On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson wrote: On 13Nov2014 15:48, satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation: fileno Is there a workaroun

Re: fileno() not supported in Python 3.1

2014-11-14 Thread Ian Kelly
On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson wrote: > On 13Nov2014 15:48, satishmlm...@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 f

Re: fileno() not supported in Python 3.1

2014-11-14 Thread Joel Goldstick
On Fri, Nov 14, 2014 at 8:59 AM, Nobody wrote: > On Thu, 13 Nov 2014 15:48:32 -0800, satishmlmlml wrote: > >> import sys >> for stream in (sys.stdin, sys.stdout, sys.stderr): >>print(stream.fileno()) >> >> >> io.UnsupportedOperation: fileno >> >> Is there a workaround? > > Try: >

Re: fileno() not supported in Python 3.1

2014-11-14 Thread Nobody
On Thu, 13 Nov 2014 15:48:32 -0800, satishmlmlml wrote: > import sys > for stream in (sys.stdin, sys.stdout, sys.stderr): >print(stream.fileno()) > > > io.UnsupportedOperation: fileno > > Is there a workaround? Try: sys.stdin.buffer.fileno() or maybe sys.stdin

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Cameron Simpson
On 13Nov2014 15:48, satishmlm...@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 h

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Cameron Simpson
On 14Nov2014 13:52, Ben Finney wrote: satishmlm...@gmail.com writes: How to get file descriptor number for the following: sys.stdin sys.stdout sys.stderr Why do you need this? What are you intending to do? In fairness, who cares? It is a basic and reasonable thing to do. I did it only last

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > How to get file descriptor number for the following: > sys.stdin > sys.stdout > sys.stderr Why do you need this? What are you intending to do? -- \ “Crime is contagious… if the government becomes a lawbreaker, | `\ it breeds contempt for the la

Re: fileno() not supported in Python 3.1

2014-11-13 Thread satishmlmlml
How to get file descriptor number for the following: sys.stdin sys.stdout sys.stderr It is displaying io.UnsupportedOperation: fileno error Kindly help. -- https://mail.python.org/mailman/listinfo/python-list

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Ben Finney
satishmlm...@gmail.com writes: > Is there a workaround? Please take the time to gather your thoughts, do not fire off a rapid series of terse scattered questions. What is it you're trying to do? What approach are you intending to take? -- \“I was in Las Vegas, at the roulette table, h

fileno() not supported in Python 3.1

2014-11-13 Thread satishmlmlml
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