"Grant Edwards" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]
> On 2004-12-07, It's me <[EMAIL PROTECTED]> wrote:
> > Why do I get an "AttributeError: read" message when I do:
> >
> >     import sys
> >     r=sys.stdin.read()
>
> Dunno. Works fine for me under 2.3.4, and according to the
> docs, should work under 2.4.
>
> What do you get when you do this:
>
>  import sys

Done that.

>  type(sys.stdin)

I get:

    <type 'instance'>

>  dir(sys.stdin)

I get:

['_RPCProxy__attributes', '_RPCProxy__getattributes',
'_RPCProxy__getmethods', '_RPCProxy__methods', '__doc__', '__getattr__',
'__init__', '__module__', 'encoding', 'oid', 'sockio']

>
> > Some sample code I saw uses this function in the same manner I
> > am and so I am assuming this is the correct syntax?
>
> Should be.
>
> > Or is this a bug in Python 2.4?
>
> That would be a little hard to believe.
>

Well, here's a copy from the Python Shell output:

>>> print sys.stdin.read(5)

Traceback (most recent call last):
  File "<pyshell#26>", line 1, in -toplevel-
    print sys.stdin.read(5)
AttributeError: read
>>>

????????


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to