Bad file descriptor

Ben Finney ben+python at benfinney.id.au
Thu Nov 13 18:56:02 EST 2014


satishmlmlml at gmail.com writes:

> import os
> os.write(1, b'Hello descriptor world\n')
> OSError: Bad file descriptor

It works fine for me::

    >>> import os
    >>> os.write(1, b'Hello descriptor world\n')
    Hello descriptor world
    23

You don't say which Python, or which version, you're using. In the
absence of different information, most of us will assume the latest
stable release of CPython. Currently, that is CPython 3.4.

-- 
 \      “I am too firm in my consciousness of the marvelous to be ever |
  `\       fascinated by the mere supernatural …” —Joseph Conrad, _The |
_o__)                                                     Shadow-Line_ |
Ben Finney




More information about the Python-list mailing list