-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: Writing to bytes TextIO stream in StreamWriter causing Attribute…
…Error on buffer member (#6034) * Fix writing to TextIO stream by decoding bytes - The TextIO's binary buffer member is not guaranteed to exist according to the python docs. (https://docs.python.org/3.8/library/io.html#io.TextIOBase.buffer) - This change decodes the bytes to a string so that we can use the write method on the TextIO stream. * Update fix to use write instead of buffer (typo) * Add test for StreamWriter with StringIO stream * Remove write_bytes and use write_str instead * Remove unused typing.Union import * Use new variable to hold output string --------- Co-authored-by: Mohamed Elasmar <[email protected]>
- Loading branch information
1 parent
b8d372a
commit 70b34aa
Showing
5 changed files
with
19 additions
and
34 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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