prompt-toolkit / python-prompt-toolkit

Library for building powerful interactive command line applications in Python
https://python-prompt-toolkit.readthedocs.io/
BSD 3-Clause "New" or "Revised" License
9.4k stars 717 forks source link

BlockingIOError: [Errno 11] write could not complete without blocking thrown in full screen app with style #864

Open WojciechMigda opened 5 years ago

WojciechMigda commented 5 years ago

Seen with:

I have a non-standard architecture, where:

Interestingly, when I set full_screen setting to False there is no exception thrown, the style is applied to the widget, and the app is running as expected. Also, if I do not apply the style to the widget the app runs fine in full screen mode. Since this is a non-standard usage I tried pulling different string by myself to see if maybe I am doing something wrong that is not mentioned in the docs, but without success. Do you maybe have a hint whether my approach has a bug somewhere or, less likely, prompt toolkit needs a fix? Thank you.

EDIT: Another twist - this error appears only when I launch my python program from within midnight commander. It does not appear within xterm.

WojciechMigda commented 5 years ago

For sure this could be fixed by ignoring also errno.EWOULDBLOCK IOError exceptions here https://github.com/prompt-toolkit/python-prompt-toolkit/blob/master/prompt_toolkit/output/vt100.py#L607