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

fix: Asynchronous input in Linux/macOS (use ainput/aprint only) #23

Merged
merged 7 commits into from
Jun 12, 2022

Conversation

plammens
Copy link
Owner

@plammens plammens commented Jun 8, 2022

Closes #17
Closes #19

… version

I made a change in 1ecea2 that was meant to affect both versions, but I only
changed it in the non-async version.

It's hard to share code between a non-async and an async function.
(The only line that changes is how input is received, `input()` vs `await ainput()`,
but there's no way to make that into a "parameter" since one is async and the
other is not.)
This is to avoid conflicts with blocking IO, i.e. input() and print().
On Linux ainput() sets the O_NONBLOCK flag, which then makes input() and print() fail.

Fixes #17, #19
@plammens plammens changed the title Fix/ainput only fix: Asynchronous input in Linux/macOS (use ainput/aprint only) Jun 11, 2022
# Conflicts:
#	src/loveletter_cli/session.py
@plammens plammens marked this pull request as ready for review June 12, 2022 21:04
@plammens plammens merged commit 22b5fa5 into master Jun 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linux: EOFError when asking input after async input MacOS: BlockingIOError
1 participant