This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: IDLE RPC Proxy for standard IO streams lacks 'errors' attribute
Type: behavior Stage: resolved
Components: IDLE Versions: Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: duplicate
Dependencies: Superseder: IDLE and Command line present different behavior for sys.stdin
View: 9290
Assigned To: ned.deily Nosy List: Ben.thelen, ezio.melotti, ned.deily, roger.serwy, serhiy.storchaka, takluyver, terry.reedy, v+python
Priority: normal Keywords:

Created on 2011-09-13 04:38 by Ben.thelen, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (17)
msg143949 - (view) Author: ben (Ben.thelen) Date: 2011-09-13 04:38
AttributeErrors on log.py in the distutils directory

import sys
stream = sys.stdout
if stream.errors == 'strict': pass'=> this will raise an AttributeError'
msg143963 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-13 12:54
When will it raise an AttributeError?
msg144002 - (view) Author: ben (Ben.thelen) Date: 2011-09-14 01:08
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>
To: thelen_ben@yahoo.com
Sent: Tuesday, 13 September 2011 8:54 PM
Subject: [issue12967] AttributeError distutils\log.py

Éric Araujo <merwok@netwok.org> added the comment:

When will it raise an AttributeError?

----------

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue12967>
_______________________________________
msg144081 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-15 14:54
> when installing the distribute package
How?  Please tell exactly what command you ran with what Python version.

> it could be raised on any other usage as sys.stdout does not have
> an 'error' attribute.
It does, in 3.x.  Do you think Python has no tests or no users? :)
msg144114 - (view) Author: ben (Ben.thelen) Date: 2011-09-16 07:45
Hi Eric,
 
I'm not suggesting that python does not test the applications. just reporting what I experience.
The python version installed is r32:88445
 
What I did, I opened the setup file (in IDLE) from the distribute 0.6.21 and run this.
 
On my python 3.2 version (clean without extentions). when I type in (on the command line)
 
>>>import sys
>>>sys.stdout.error
'strict'
 
However on the IDLE when I do the same.
a AttributeError is being raised.
 
Not sure why the difference between the two (I thought these were the same).
 
Ben

From: Éric Araujo <report@bugs.python.org>
To: thelen_ben@yahoo.com
Sent: Thursday, 15 September 2011 10:54 PM
Subject: [issue12967] AttributeError distutils\log.py

É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? :)

----------
assignee: tarek -> eric.araujo

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue12967>
_______________________________________
msg144158 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-09-16 20:43
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.
msg144187 - (view) Author: ben (Ben.thelen) Date: 2011-09-17 14:27
Hi Ned,
 
Not sure if I fully understand the IDLE issue, I'm still learning Python (abt. 6 months). Nevertheless I've installed the distributes through the command line.
 
if you want to reassign this issue to IDLE, please do so.
 
Best regards,
 
Ben Thelen
 
 

From: Ned Deily <report@bugs.python.org>
To: thelen_ben@yahoo.com
Sent: Saturday, 17 September 2011 4:43 AM
Subject: [issue12967] AttributeError distutils\log.py

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.

----------
nosy: +ned.deily

_______________________________________
Python tracker <report@bugs.python.org>
<http://bugs.python.org/issue12967>
_______________________________________
msg144190 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-09-17 15:12
> I'm not suggesting that python does not test the applications. just reporting
> what I experience.
I was joking :)  What I meant was: I can’t agree with the statement “it could be raised on any other usage as sys.stdout does not have an 'error' attribute” because we have tests and users that use distutils without seeing this error.

> What I did, I opened the setup file (in IDLE) from the distribute 0.6.21 and run this.
setup.py is meant to be run from the command line only.  If you try to run it from IDLE, the behavior is undefined, so I’m inclined to close this bug as invalid.

(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!)
msg145204 - (view) Author: Éric Araujo (eric.araujo) * (Python committer) Date: 2011-10-09 03:04
I stand by my opinion that running setup.py from IDLE is not supported.
msg145215 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2011-10-09 05:06
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 `errors` attribute was added to file objects and io streams in 2.6 but support for that was not added to IDLE.  I think that should be fixed.
msg145565 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2011-10-14 22:19
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.
msg164623 - (view) Author: Glenn Linderman (v+python) * Date: 2012-07-03 20:52
So this looks like it might be a simple fix... in issue 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...
msg165193 - (view) Author: Roger Serwy (roger.serwy) * (Python committer) Date: 2012-07-10 15:10
Issue13532 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.
msg172596 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2012-10-10 17:33
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 issue9290 will solve this issue.
msg175733 - (view) Author: Thomas Kluyver (takluyver) * Date: 2012-11-17 11:52
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.
http://stackoverflow.com/questions/13368040/ipython-installation-on-3-3-x64-errors
msg175777 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-11-17 17:09
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.
msg175781 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2012-11-17 17:19
Even though the title of #9290 says stdin, the patches are for all std** streams, so should cover this.
History
Date User Action Args
2022-04-11 14:57:21adminsetgithub: 57176
2012-11-17 17:19:22terry.reedysetstage: needs patch -> resolved
2012-11-17 17:19:11terry.reedysetstatus: open -> closed

messages: + msg175781
2012-11-17 17:09:25terry.reedysetstatus: pending -> open

messages: + msg175777
2012-11-17 14:39:17serhiy.storchakasetstatus: open -> pending
superseder: IDLE and Command line present different behavior for sys.stdin
resolution: duplicate
2012-11-17 11:52:48takluyversetnosy: + takluyver
messages: + msg175733
2012-10-10 17:33:49serhiy.storchakasetnosy: + serhiy.storchaka
messages: + msg172596
2012-07-10 15:10:12roger.serwysetmessages: + msg165193
2012-07-03 21:00:03terry.reedysetnosy: + roger.serwy
2012-07-03 20:52:22v+pythonsetnosy: + v+python
messages: + msg164623
2011-10-14 23:39:46ezio.melottisetnosy: + ezio.melotti
2011-10-14 22:19:27terry.reedysetnosy: + terry.reedy
messages: + msg145565
2011-10-09 05:08:10eric.araujosetnosy: - tarek, eric.araujo
2011-10-09 05:06:54ned.deilysetstatus: closed -> open

assignee: eric.araujo -> ned.deily
components: + IDLE, - Distutils
title: AttributeError distutils\log.py -> IDLE RPC Proxy for standard IO streams lacks 'errors' attribute
resolution: wont fix -> (no value)
versions: + Python 2.7, Python 3.3
messages: + msg145215
stage: resolved -> needs patch
2011-10-09 03:04:22eric.araujosetstatus: open -> closed
type: compile error -> behavior
messages: + msg145204

resolution: wont fix
stage: resolved
2011-09-17 15:12:28eric.araujosetmessages: + msg144190
2011-09-17 15:08:06eric.araujosetfiles: - unnamed
2011-09-17 15:08:05eric.araujosetfiles: - unnamed
2011-09-17 15:08:03eric.araujosetfiles: - log.py
2011-09-17 14:27:54Ben.thelensetfiles: + unnamed

messages: + msg144187
2011-09-16 20:43:50ned.deilysetnosy: + ned.deily
messages: + msg144158
2011-09-16 07:45:56Ben.thelensetfiles: + unnamed

messages: + msg144114
2011-09-15 14:54:17eric.araujosetassignee: tarek -> eric.araujo
messages: + msg144081
2011-09-15 14:47:38eric.araujosetfiles: - unnamed
2011-09-14 01:08:22Ben.thelensetfiles: + unnamed

messages: + msg144002
2011-09-13 12:54:31eric.araujosetmessages: + msg143963
2011-09-13 04:38:10Ben.thelencreate