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

[BUG]: BlockingIOError #412

Open
MilesCranmer opened this issue Aug 20, 2023 · 2 comments
Open

[BUG]: BlockingIOError #412

MilesCranmer opened this issue Aug 20, 2023 · 2 comments
Labels
bug Something isn't working

Comments

@MilesCranmer
Copy link
Owner

MilesCranmer commented Aug 20, 2023

First mentioned by @villrv in #411

Looks like it shows up sometimes for me as well. For example:

  File "/Users/mcranmer/Documents/PySR/.venv/bin/ipython", line 8, in <module>
    sys.exit(start_ipython())
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/__init__.py", line 129, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/traitlets/config/application.py", line 1043, in launch_instance
    app.start()
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/terminal/ipapp.py", line 318, in start
    self.shell.mainloop()
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 888, in mainloop
    self.interact()
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 870, in interact
    print(self.separate_in, end='')
BlockingIOError: [Errno 35] write could not complete without blocking
Error in sys.excepthook:
Traceback (most recent call last):
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/core/application.py", line 286, in excepthook
    return crashhandler.crash_handler_lite(etype, evalue, tb)
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/core/crashhandler.py", line 226, in crash_handler_lite
    traceback.print_exception(etype, evalue, tb)
  File "/Users/mcranmer/.pyenv/versions/3.10.10/lib/python3.10/traceback.py", line 121, in print_exception
    print(line, file=file, end="")
BlockingIOError: [Errno 35] write could not complete without blocking

Original exception was:
Traceback (most recent call last):
  File "/Users/mcranmer/Documents/PySR/.venv/bin/ipython", line 8, in <module>
    sys.exit(start_ipython())
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/__init__.py", line 129, in start_ipython
    return launch_new_instance(argv=argv, **kwargs)
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/traitlets/config/application.py", line 1043, in launch_instance
    app.start()
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/terminal/ipapp.py", line 318, in start
    self.shell.mainloop()
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 888, in mainloop
    self.interact()
  File "/Users/mcranmer/Documents/PySR/.venv/lib/python3.10/site-packages/IPython/terminal/interactiveshell.py", line 870, in interact
    print(self.separate_in, end='')
BlockingIOError: [Errno 35] write could not complete without blocking

This is with Julia 1.9. I didn't see it on Julia 1.10. I wonder if it's some conflict between the latest IPython versions and PyJulia?

@MilesCranmer
Copy link
Owner Author

I think this error happens when Julia encounters an error within a thread other than the main thread.

A workaround would be to suppress all output from individual threads, and print them in the main thread.

@MilesCranmer MilesCranmer added the bug Something isn't working label Aug 20, 2023
@MilesCranmer
Copy link
Owner Author

Need to find a reliable way to reproduce this in a unit test...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant