Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sys.stdin.fileno() gives attribute error in IDLE #47253

Closed
markveldhuis mannequin opened this issue May 29, 2008 · 3 comments
Closed

sys.stdin.fileno() gives attribute error in IDLE #47253

markveldhuis mannequin opened this issue May 29, 2008 · 3 comments
Assignees
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error

Comments

@markveldhuis
Copy link
Mannequin

markveldhuis mannequin commented May 29, 2008

BPO 3003
Nosy @kbkaiser, @devdanzin

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/kbkaiser'
closed_at = <Date 2009-05-18.05:10:00.616>
created_at = <Date 2008-05-29.16:43:55.249>
labels = ['expert-IDLE', 'type-bug']
title = 'sys.stdin.fileno() gives attribute error in IDLE'
updated_at = <Date 2009-05-18.05:10:00.497>
user = 'https://bugs.python.org/markveldhuis'

bugs.python.org fields:

activity = <Date 2009-05-18.05:10:00.497>
actor = 'kbk'
assignee = 'kbk'
closed = True
closed_date = <Date 2009-05-18.05:10:00.616>
closer = 'kbk'
components = ['IDLE']
creation = <Date 2008-05-29.16:43:55.249>
creator = 'markveldhuis'
dependencies = []
files = []
hgrepos = []
issue_num = 3003
keywords = []
message_count = 3.0
messages = ['67503', '86614', '88015']
nosy_count = 4.0
nosy_names = ['kbk', 'ajaksu2', 'gpolo', 'markveldhuis']
pr_nums = []
priority = 'normal'
resolution = 'works for me'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue3003'
versions = ['Python 2.6']

@markveldhuis
Copy link
Mannequin Author

markveldhuis mannequin commented May 29, 2008

I am using IDLE on Ubuntu Hardy (8.04) and all in all very content to
use it. Today I got an AttributeError using sys.stdin.fileno(). A closer
look revealed this:

in IDLE:

Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42)
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "copyright", "credits" or "license()" for more information.

    ****************************************************************
    Personal firewall software may warn about the connection IDLE
    makes to its subprocess using this computer's internal loopback
    interface.  This connection is not visible on any external
    interface and no data is sent to or received from the Internet.
    ****************************************************************
    
IDLE 1.2.2      
>>> import sys
>>> dir(sys.stdin)
['_RPCProxy__attributes', '_RPCProxy__getattributes',
'_RPCProxy__getmethods', '_RPCProxy__methods', '__class__',
'__delattr__', '__dict__', '__doc__', '__getattr__', '__getattribute__',
'__hash__', '__init__', '__module__', '__new__', '__reduce__',
'__reduce_ex__', '__repr__', '__setattr__', '__str__', '__weakref__',
'encoding', 'oid', 'sockio']
>>> 

in terminal:

:~$ python
Python 2.5.2 (r252:60911, Apr 21 2008, 11:12:42) 
[GCC 4.2.3 (Ubuntu 4.2.3-2ubuntu7)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> dir(sys.stdin)
['__class__', '__delattr__', '__doc__', '__enter__', '__exit__',
'__getattribute__', '__hash__', '__init__', '__iter__', '__new__',
'__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__str__',
'close', 'closed', 'encoding', 'fileno', 'flush', 'isatty', 'mode',
'name', 'newlines', 'next', 'read', 'readinto', 'readline', 'readlines',
'seek', 'softspace', 'tell', 'truncate', 'write', 'writelines',
'xreadlines']
>>> 

I expected to see more or less the same output, is that right? I could
not find information on this online, so I report it as a bug.

greetings, Mark

@markveldhuis markveldhuis mannequin added the topic-IDLE label May 29, 2008
@devdanzin
Copy link
Mannequin

devdanzin mannequin commented Apr 26, 2009

I think this isn't a bug, but an implementation detail. Guilherme?

@devdanzin devdanzin mannequin added the type-bug An unexpected behavior, bug, or error label Apr 26, 2009
@kbkaiser
Copy link
Contributor

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

Don't attempt sys.stdin._RPCProxy_methods lest you be turned to
stone ;-)

We didn't implement all the features of stdin as it didn't seem
necessary. Did you have a specific reason to access
stdin.fileno() ?

stdin/out/err support communications between the subprocess and
the IDLE GUI through a socket. They are redirected in the GUI and
proxied in the subprocess.

@kbkaiser kbkaiser self-assigned this May 18, 2009
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-IDLE type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

1 participant