sys.stdin.read() HELP!

Andrey Revyakin revyakag at umdnj.edu
Wed Jul 4 15:42:33 EDT 2001


There's not much code in my srcript - just

import sys
text = sys.stdin.read()
... and then goes string parsing for the text.

If I try using sys.stdin from the shell it works ok.

The machines definitely differ more than by the version of python. In fact
it's a brand new server, and I am not the one who moved stuff onto it. well,
and I don't know much od sysadmin stuff - but if you could give me aclue what
could be the reason I could talk to the guy.

Here are some enviromental variables:

'GATEWAY_INTERFACE': 'CGI/1.1'
'SERVER_SIGNATURE': '<ADDRESS>Apache/1.3.19'
'SERVER_SOFTWARE': 'Apache/1.3.19'



Michael Hudson wrote:

> Andrey Revyakin <revyakag at umdnj.edu> writes:
>
> > I have a cgi script which reads XML data from a FLASH5 movie. The script
> > reads data into a string like this:
> >
> > text = sys.stdin.read()
> >
> > After I moved my scripts from a machine with python 1.7.2 to to a one
>
> 1.5.2, I presume?
>
> > with python 2 .0, I started getting the following error:
> >
> > text = sys.stdin.read()
> > IOError: [Errno 9] Bad file descriptor
> >
> > WHAT THE #$^ does that mean???
>
> It means sys.stdin isn't attached properly.  This is unlikely to be
> Python's fault, I'd have thought.  Can you shed a few more details as
> to the environment you're working in?  Maybe somebody who has
> experience in these things will be able to spot the mis-config (not
> likely to be me).
>
> Are you sure the version of Python is the only difference between the
> two machines?
>
> Cheers,
> M.
>
> --
>   The only problem with Microsoft is they just have no taste.
>               -- Steve Jobs, (From _Triumph of the Nerds_ PBS special)
>                          and quoted by Aahz Maruch on comp.lang.python




More information about the Python-list mailing list