Skip to content

faulthandler stdlib module requires fileno on stdout #628

Closed

Description

@goetzc

Like issue #622, this one for 'fileno'.

bpython version 0.15 on top of Python 3.5.2 /usr/bin/python
>>> import pyqtgraph.examples
Traceback (most recent call last):
  File "<input>", line 1, in <module>
    import pyqtgraph.examples
  File "/usr/lib/python3.5/site-packages/pyqtgraph/examples/__init__.py", line 1, in <module>
    from .__main__ import run
  File "/usr/lib/python3.5/site-packages/pyqtgraph/examples/__main__.py", line 9, in <module>
    from . import initExample
  File "/usr/lib/python3.5/site-packages/pyqtgraph/examples/initExample.py", line 40, in <module>
    faulthandler.enable()
AttributeError: 'FakeOutput' object has no attribute 'fileno'

Activity

  1. changed the title [-]AttributeError: 'FakeOutput' object has no attribute 'fileno'[/-] [+]faulthandler stdlib module requires fileno on stdout[/+] on Aug 5, 2016
  2. thomasballinger commented on Aug 5, 2016

    @thomasballinger
    Member

    It looks like this is due to

    import faulthandler
    faulthandler.enable()

    Someone should look into what faulthandler and see what it wanted to do with fileno to see what we should do about it.

    • maybe we should give it the fileno of real stdout
    • maybe we should give it a new fileno it could write to that bpython could listen on
  3. Kashyap12 commented on Nov 24, 2016

    @Kashyap12

    hi @thomasballinger , I am new to open source, would love to contribute

  4. thomasballinger commented on Nov 24, 2016

    @thomasballinger
    Member

    @Kashyap12, great to hear, and welcome! Would you like to take a look at this issue? You can contact me at [email protected] or on freenode in #bpython if you want to talk in depth about how to get started or you have questions, or you're welcome to ask them here; @goetzc can mute this thread if it gets long ;)

    The first thing you'll want to do is to try out bpython; it'll be helpful context for this issue. You can either pip install it, which would work well enough to start working on this issue, or you can follow these instructions to get a version of the source code that's easy to change on your machine.

    There are a few tasks I can think of for this issue:

    • Reproducing the problem by installing pygtgraph and bpython and getting this error again
    • Looking at the source code for faulthandler to figure out why it needs with a fileno on stdout
    • Figuring out what behavior was expected here: what does running this code in the regular Python interpreter do?
    • Trying out adding in a fileno method to stdout that returns the real stdout fileno and seeing how that works

    Because faulthandler is part of the standard library, we should definitely try to find a solution that makes this work. I have some ideas (main one: making a new pipe that user Python code like this can write to that we'd combine with regular stdout.write output) but not enough information to know if that approach is necessary.

  5. Kashyap12 commented on Nov 24, 2016

    @Kashyap12

    Hi @goetzc @thomasballinger , I tried to reproduce the same issue on my bpython set up, i.e.
    bpython version 0.16 on top of Python 2.7.6 /usr/bin/python , I pip installed pyqtgraph and then ran the below command on bpython :
    import pyqtgraph.examples

    I got no error :)

  6. goetzc commented on Nov 24, 2016

    @goetzc
    Author

    FWIW, with bpython upgraded to 0.16 (and maintaining Python at 3.5.2) I don't get the error :)

  7. Kashyap12 commented on Nov 25, 2016

    @Kashyap12

    @goetzc so is this issue closed?

  8. thomasballinger commented on Nov 25, 2016

    @thomasballinger
    Member

    Oh great! It looks like this was fixed by #616.

    Thanks for digging into this more @Kashyap12, and thanks @goetzc for reporting and testing again!

    @Kashyap12, let me know if you're interested contributing more and would like suggestions for issues. bitesize would be a good place to start.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions