Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #80756

Re: io.UnsupportedOperation: fileno

From Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de>
Newsgroups comp.lang.python
Subject Re: io.UnsupportedOperation: fileno
Date 2014-11-14 12:29 +0100
Organization A not so newly installed InterNetNews server
Message-ID <m44p2i$tch$1@r01.glglgl.de> (permalink)
References <b501dd95-8ef0-476d-90ff-bf7b44894679@googlegroups.com> <5afd4b4e-e0cd-4436-b15a-936637b4fe2b@googlegroups.com> <b4f3265d-0286-4539-909f-d9e7644277f7@googlegroups.com>

Show all headers | View raw


Am 14.11.2014 00:42 schrieb satishmlmlml@gmail.com:
> fileno() in not supported. Is it only in 3.1? What is the workaround?

You have been asked many times about the details of your environment.

Especially, you have been told that it is important to know if you 
directly use the Python CLI or some GUI like IDLE.

I just tested the latter thing and found out that it indeed makes a 
difference, as it introduces a replacement for the std* stuff you are 
missing:

 >>> sys.stdin
<idlelib.PyShell.PseudoInputFile object at 0x0000000002EAD588>
 >>> sys.stdout
<idlelib.PyShell.PseudoOutputFile object at 0x0000000002EAD5C0>
 >>> sys.stderr
<idlelib.PyShell.PseudoOutputFile object at 0x0000000002EAD5F8>

Calling .fileno() on such a Pseudo*File just raises an 
UnsupportedOperation exception.

This is in contrast to using the CLI directly.

Back to comp.lang.python | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

io.UnsupportedOperation: fileno satishmlmlml@gmail.com - 2014-11-13 15:23 -0800
  Re: io.UnsupportedOperation: fileno sohcahtoa82@gmail.com - 2014-11-13 15:30 -0800
    Re: io.UnsupportedOperation: fileno satishmlmlml@gmail.com - 2014-11-13 15:34 -0800
      Re: io.UnsupportedOperation: fileno Chris Angelico <rosuav@gmail.com> - 2014-11-14 10:40 +1100
      Re: io.UnsupportedOperation: fileno Ben Finney <ben+python@benfinney.id.au> - 2014-11-14 10:42 +1100
      Re: io.UnsupportedOperation: fileno Mark Lawrence <breamoreboy@yahoo.co.uk> - 2014-11-14 05:10 +0000
    Re: io.UnsupportedOperation: fileno satishmlmlml@gmail.com - 2014-11-13 15:42 -0800
      Re: io.UnsupportedOperation: fileno Ben Finney <ben+python@benfinney.id.au> - 2014-11-14 10:52 +1100
      Re: io.UnsupportedOperation: fileno Thomas Rachel <nutznetz-0c1b6768-bfa9-48d5-a470-7603bd3aa915@spamschutz.glglgl.de> - 2014-11-14 12:29 +0100

csiph-web