Skip to content

fix: gracefully handle SIGPIPE#236

Merged
Secrus merged 1 commit intopython-poetry:mainfrom
branchv:fix/SIGPIPE
Sep 2, 2022
Merged

fix: gracefully handle SIGPIPE#236
Secrus merged 1 commit intopython-poetry:mainfrom
branchv:fix/SIGPIPE

Conversation

@branchv
Copy link
Copy Markdown
Member

@branchv branchv commented Aug 25, 2022

When fixing #234, I noticed cleo's terminal prompt wasn't rendering until after reading a response:

$ poetry cache clear --all .
no # cleo is prompting here
Delete 575 entries? (yes/no) [no] # but output is displayed later

This was introduced via #165, since now we aren't always flushing the output. This reverts that and instead suppresses a broken pipe error, which was the initial motivation for that PR.
Note that click also always flushes output and similary ignores broken pipes.

I manually tested this with poetry -V | head -1

Closes #56

Comment thread cleo/application.py Outdated
@Secrus
Copy link
Copy Markdown
Member

Secrus commented Aug 29, 2022

I think this could resolve #56, could you confirm?

@branchv branchv marked this pull request as ready for review September 2, 2022 01:24
@branchv branchv requested review from Secrus and dimbleby and removed request for dimbleby September 2, 2022 01:27
@Secrus Secrus merged commit ac59662 into python-poetry:main Sep 2, 2022
@branchv branchv deleted the fix/SIGPIPE branch September 2, 2022 12:04
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.

cleo does not handle SIGPIPE / errno.EPIPE

3 participants