Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5975625
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T21:06:45+00:00 2026-05-22T21:06:45+00:00

In python 3.2 under OSX, if I’ll run type(sys.stdin) under Idle I get a

  • 0

In python 3.2 under OSX, if I’ll run “type(sys.stdin)” under Idle I get a strange answer as shown below

>>> type(sys.stdin)
<class 'idlelib.rpc.RPCProxy'>
>>> 

But if I’ll reun the same command under terminal, I get:

>>> import sys
>>> type(sys.stdin)
<class '_io.TextIOWrapper'>
>>> 

I understand this is because I’m running it under IDLE. but is this not misleading?

I was trying to run the following commands in IDLE and spent hours trying to understand as to why this is not working. (I’m still a python noob)

>>> w = sys.stdin.readlines()
Traceback (most recent call last):
  File "<pyshell#4>", line 1, in <module>
    w = sys.stdin.readlines()
AttributeError: readlines

But just discovered that I works fine under terminal.

>>> w = sys.stdin.readlines()
wow
ww
wewew
>>> 
>>> w
['wow\n', 'ww\n', 'wewew\n']
>>> 

Is this a bug?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T21:06:45+00:00Added an answer on May 22, 2026 at 9:06 pm

    This is a filed Python bug:

    http://bugs.python.org/issue9290

    The fact that in IDLE sys.stdin is a
    idlelib.rpc.RPCProxy results in
    programs having different behavior in
    IDLE and in Command Line mode.

    I noticed that when grading many
    students exercises in IDLE. Things
    like:

    sys.stdin.readlines()
    

    just don´t exists in IDLE, but are
    fully operational in Command Line
    mode.

    In Command Line mode, sys.stdin is a
    file.

    This is expected, as the manual (27.1)
    says that sys.stdin (and stdout and
    stderrr) are “File objects
    corresponding to the interpreter’s
    standard input”

    There are also other “quirks”.

    I fell that is really strange that
    stdin has different behavior for the
    same program.


    Note that this is probably not fixed because readlines is not normally useful. Instead, you can just iterate over the file objects itself:

    for line in sys.stdin:
        ...
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to run some python code under Apache 2.2 / mod_python 3.2.8. Eventually
Is it possible to create an environment to safely run arbitrary Python scripts under
I can't seem to get the wsgiref module to work at all under Python
I'm trying to run mod_wsgi 3.1 under Apache 2.2.14 using a non-default python installation
What's wrong with the following code (under Python 2.7.1): class TestFailed(BaseException): def __new__(self, m):
Under Python 3.1, when trying to run this code: from urllib import request def
Is there any existing way to run XQuery under python? (not starting to build
I have a strange issue specific to my Django deployment under Python 2.6 +
I'm confused with file moving under python. Under windows commandline, if i have directory
Has anyone seen anything in Tix work under python 3.0? I've tried to work

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.