Skip to content

IDLE RPC Proxy for standard IO streams lacks 'errors' attribute #57176

Closed

Description

@Benthelen
mannequin
BPO 12967
Nosy @terryjreedy, @ned-deily, @ezio-melotti, @serwy, @takluyver, @serhiy-storchaka
Superseder
  • bpo-9290: IDLE and Command line present different behavior for sys.stdin
  • 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/ned-deily'
    closed_at = <Date 2012-11-17.17:19:11.494>
    created_at = <Date 2011-09-13.04:38:10.330>
    labels = ['expert-IDLE', 'type-bug']
    title = "IDLE RPC Proxy for standard IO streams lacks 'errors' attribute"
    updated_at = <Date 2012-11-17.17:19:22.784>
    user = 'https://bugs.python.org/Benthelen'

    bugs.python.org fields:

    activity = <Date 2012-11-17.17:19:22.784>
    actor = 'terry.reedy'
    assignee = 'ned.deily'
    closed = True
    closed_date = <Date 2012-11-17.17:19:11.494>
    closer = 'terry.reedy'
    components = ['IDLE']
    creation = <Date 2011-09-13.04:38:10.330>
    creator = 'Ben.thelen'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 12967
    keywords = []
    message_count = 17.0
    messages = ['143949', '143963', '144002', '144081', '144114', '144158', '144187', '144190', '145204', '145215', '145565', '164623', '165193', '172596', '175733', '175777', '175781']
    nosy_count = 8.0
    nosy_names = ['terry.reedy', 'ned.deily', 'ezio.melotti', 'roger.serwy', 'v+python', 'takluyver', 'Ben.thelen', 'serhiy.storchaka']
    pr_nums = []
    priority = 'normal'
    resolution = 'duplicate'
    stage = 'resolved'
    status = 'closed'
    superseder = '9290'
    type = 'behavior'
    url = 'https://bugs.python.org/issue12967'
    versions = ['Python 2.7', 'Python 3.2', 'Python 3.3']

    Activity

    1. Benthelen commented on Sep 13, 2011

      Benthelenmannequin
      MannequinAuthor

      AttributeErrors on log.py in the distutils directory

      import sys
      stream = sys.stdout
      if stream.errors == 'strict': pass'=> this will raise an AttributeError'
    2. added
      buildThe build process and cross-build
      stdlibStandard Library Python modules in the Lib/ directory
      on Sep 13, 2011
    3. merwok commented on Sep 13, 2011

      @merwok
      Member

      When will it raise an AttributeError?

    4. Benthelen commented on Sep 14, 2011

      Benthelenmannequin
      MannequinAuthor

      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: [bpo-12967] 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\>


    5. merwok commented on Sep 15, 2011

      @merwok
      Member

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

    6. assigned and unassigned on Sep 15, 2011
    7. Benthelen commented on Sep 16, 2011

      Benthelenmannequin
      MannequinAuthor

      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: [bpo-12967] 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\>


    8. ned-deily commented on Sep 16, 2011

      @ned-deily
      Member

      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.

    9. Benthelen commented on Sep 17, 2011

      Benthelenmannequin
      MannequinAuthor

      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: [bpo-12967] 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\>


    10. merwok commented on Sep 17, 2011

      @merwok
      Member

      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!)

    11. merwok commented on Oct 9, 2011

      @merwok
      Member

      I stand by my opinion that running setup.py from IDLE is not supported.

    12. 3 remaining items

    13. added and removed
      stdlibStandard Library Python modules in the Lib/ directory
      on Oct 9, 2011
    14. changed the title [-]AttributeError distutils\log.py[/-] [+]IDLE RPC Proxy for standard IO streams lacks 'errors' attribute[/+] on Oct 9, 2011
    15. terryjreedy commented on Oct 14, 2011

      @terryjreedy
      Member

      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.

    16. vpython commented on Jul 3, 2012

      vpythonmannequin
      Mannequin

      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...

    17. serwy commented on Jul 10, 2012

      serwymannequin
      Mannequin

      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.

    18. serhiy-storchaka commented on Oct 10, 2012

      @serhiy-storchaka
      Member

      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.

    19. takluyver commented on Nov 17, 2012

      takluyvermannequin
      Mannequin

      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

    20. terryjreedy commented on Nov 17, 2012

      @terryjreedy
      Member

      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.

    21. terryjreedy commented on Nov 17, 2012

      @terryjreedy
      Member

      Even though the title of bpo-9290 says stdin, the patches are for all std** streams, so should cover this.

    22. transferred this issue fromon Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

    Metadata

    Metadata

    Assignees

    Labels

    topic-IDLEtype-bugAn unexpected behavior, bug, or error

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions