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 c...@zip.com.au wrote: On 13Nov2014 15:48, satishmlm...@gmail.com satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation:

Re: fileno() not supported in Python 3.1

2014-11-15 Thread Dan Stromberg
On Thu, Nov 13, 2014 at 3:48 PM, 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? -- https://mail.python.org/mailman/listinfo/python-list Works for me,

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 drsali...@gmail.com 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.

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

Re: fileno() not supported in Python 3.1

2014-11-14 Thread Joel Goldstick
On Fri, Nov 14, 2014 at 8:59 AM, Nobody nobody@nowhere.invalid 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 Ian Kelly
On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson c...@zip.com.au wrote: On 13Nov2014 15:48, satishmlm...@gmail.com satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr): print(stream.fileno()) io.UnsupportedOperation: fileno Is there a

Re: fileno() not supported in Python 3.1

2014-11-14 Thread Cameron Simpson
On 14Nov2014 09:51, Ian Kelly ian.g.ke...@gmail.com wrote: On Fri, Nov 14, 2014 at 12:36 AM, Cameron Simpson c...@zip.com.au wrote: On 13Nov2014 15:48, satishmlm...@gmail.com satishmlm...@gmail.com wrote: import sys for stream in (sys.stdin, sys.stdout, sys.stderr):

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

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,

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: 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 law.”

Re: fileno() not supported in Python 3.1

2014-11-13 Thread Cameron Simpson
On 14Nov2014 13:52, Ben Finney ben+pyt...@benfinney.id.au 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

Re: fileno() not supported in Python 3.1

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