Uh oh!
There was an error while loading. Please reload this page.
Console.Unix: fix OpenStandardInput Stream sometimes throwing for Reads. - #62153
Conversation
When connected to a terminal reads happen line-by-line. StdInReader caches the line in a StringBuilder. Instead of returning when the destination buffer is full, an attempt was made to decode the next chunk from the StringBuilder (if there is one). This causes the encoder to throw for encoding into an empty buffer.
ghost
commented
Nov 29, 2021
Tagging subscribers to this area: @dotnet/area-system-console Issue DetailsWhen connected to a terminal reads happen line-by-line. StdInReader caches the line in a StringBuilder. Instead of returning when the destination buffer is full, an attempt Fixes #61865. @dotnet/area-system-console ptal. cc @dmbarbour
|
adamsitnik
left a comment
There was a problem hiding this comment.
@tmds thank you for your contribution! I've left some comments, PTAL
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
tmds
commented
Nov 30, 2021
Adam, thank you for reviewing! I've addressed your feedback. |
adamsitnik
left a comment
There was a problem hiding this comment.
@tmds thank you for addressing the feedback, LGTM. ![]()
When connected to a terminal reads happen line-by-line.
This was added in .NET 5 by #39192.
StdInReader caches the line in a StringBuilder.
Instead of returning when the destination buffer is full, an attempt
was made to decode the next chunk from the StringBuilder (if there is
one). This causes the encoder to throw for encoding into an empty buffer.
Fixes#61865.
@dotnet/area-system-console ptal.
cc @dmbarbour