_winconsole._WindowsConsoleWriter should loop until it writes all data#818
Closed
segevfiner wants to merge 1 commit intopallets:masterfrom
Closed
_winconsole._WindowsConsoleWriter should loop until it writes all data#818segevfiner wants to merge 1 commit intopallets:masterfrom
segevfiner wants to merge 1 commit intopallets:masterfrom
Conversation
TextIOWrapper expects a *buffered* stream not an unbuffered one. It wont check how much data was written and will drop data if you don't write it all. Another option is to wrap in a io.BufferedWriter. This reproduces quite well on Python 3.6. Likely due to changes in TextIOWrapper. Fixes: pallets#816
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
TextIOWrapperexpects a buffered stream not an unbuffered one. It wont check how much data was written and will drop data if you don't write it all. Another option is to wrap in aio.BufferedWriter, which I think is whatwin-unicode-consoledoes (PR #819).This reproduces quite well on Python 3.6. Likely due to changes in
TextIOWrapper.Please review carefully that I haven't screwed up the IO loop it's easy to get this things wrong 😝
Fixes: #816
P.S. I think
get_bufferis a use after free... I think you are supposed to keep thePy_bufferalive while you are using the buffer... 😖@pcapel Could you test this so we can be sure this is really the issue?
EDIT: Now that I think about it, I probably prefer PR #819.