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
IDLE RPC Proxy for standard IO streams lacks 'errors' attribute #57176
Comments
AttributeErrors on log.py in the distutils directory import sys
stream = sys.stdout
if stream.errors == 'strict': pass'=> this will raise an AttributeError' |
When will it raise an AttributeError? |
Error had been raised when installing the distribute package, but it could be raised on any other usage as sys.stdout does not have an 'error' attribute. From: Éric Araujo <report@bugs.python.org> Éric Araujo <merwok@netwok.org> added the comment: When will it raise an AttributeError? ---------- Python tracker <report@bugs.python.org> |
|
Hi Eric,
From: Éric Araujo <report@bugs.python.org> Éric Araujo <merwok@netwok.org> added the comment: How? Please tell exactly what command you ran with what Python version. It does, in 3.x. Do you think Python has no tests or no users? :) ---------- Python tracker <report@bugs.python.org> |
That won't work in IDLE because IDLE replaces the standard sys.stdout file object with a special proxy object to capture stdout across its processes and the proxy object does not currently support all of the attributes of a io.TextTIOWrapper object, like errors. >>> sys.stdout
<idlelib.rpc.RPCProxy object at 0x1282b30> If that is the only problem, perhaps this issue should be reassigned to IDLE to support errors and any other relevant new attributes. |
Hi Ned, From: Ned Deily <report@bugs.python.org> Ned Deily <nad@acm.org> added the comment: That won't work in IDLE because IDLE replaces the standard sys.stdout file object with a special proxy object to capture stdout across its processes and the proxy object does not currently support all of the attributes of a io.TextTIOWrapper object, like errors. <idlelib.rpc.RPCProxy object at 0x1282b30> If that is the only problem, perhaps this issue should be reassigned to IDLE to support errors and any other relevant new attributes. ---------- Python tracker <report@bugs.python.org> |
(A note about this bug tracker: please do not send HTML email, it gets transformed into an unhelpful attachment, and also don’t include whole messages after your reply when you send email. Thanks in advance!) |
I stand by my opinion that running setup.py from IDLE is not supported. |
I don't have a strong opinion about whether running setup.py in IDLE is supported. But that's not the real issue here. The problem is that the IDLE RPC proxy of the standard IO streams is incomplete, in particular, the 'errors' attribute of io.TextIOWrapper streams. Looking back, it appears that the |
Thank you for redirecting this issue. The goal should be to make the proxies completely transparent. They mostly are, but occasional issues arise when they are not. Sometimes the source of a problem is not clear. I wonder, for instance, whether the non-function in IDLE of >>> print(input())
abc\
abc\ has anything to do with the bidirectional communication or is entirely internal to IDLE. |
So this looks like it might be a simple fix... in bpo-1602, there was a patch for Windows console for 3.1... sadly not applied then, or 3.2, or 3.3 (yet). But in 3.2, the fix sprouted a failure just like this one: the console output class would get reported to not have an "errors" attribute when doing an input. A fix there was to add an attribute errors='strict' to the console output class. Here it seems the same symptom sprouted in the same time frame, for a similar situation where the output class has been replaced by one that doesn't have an errors attribute... so it should grow one... |
bpo-13532 has an applied patch (422242dbce30) for the subprocess that makes the stdout, stderr, and stdin inherit from io.TextIOBase. This includes the "errors" attribute, albeit set to ''. The fix does not apply when running IDLE without a subprocess, so the .errors attribute will still be missing. |
If this issue only about 'errors' attribute of IDLE RPC Proxy for standard IO streams, then it should be closed as outdated. If this issue about 'errors' attribute of IDLE standard IO streams (even when running IDLE without a subprocess), then the patches for bpo-9290 will solve this issue. |
It seems pretty arbitrary and newcomer-unfriendly to decide that Python doesn't support running setup.py inside IDLE. Exhibit A: confused newcomer trying to install distribute, getting unhelpful error message. |
Thomas, please re-read the messages starting msg145215 where it was decided that this is not an issue about setup.py in particular. There appears to now only be a problem if IDLE is run without a subprocess, and that option may disappear in 3.4 as unneeded. |
Even though the title of bpo-9290 says stdin, the patches are for all std** streams, so should cover this. |
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:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: