Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit d44768f

Browse files
Issue #24608: chunk.Chunk.read() now always returns bytes, not str.
1 parent e0fd7ef commit d44768f

2 files changed

Lines changed: 3 additions & 1 deletion

File tree

Lib/chunk.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ def read(self, size=-1):
128128
if self.closed:
129129
raise ValueError("I/O operation on closed file")
130130
if self.size_read >= self.chunksize:
131-
return ''
131+
return b''
132132
if size < 0:
133133
size = self.chunksize - self.size_read
134134
if size > self.chunksize - self.size_read:

Misc/NEWS

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,8 @@ Core and Builtins
6666
Library
6767
-------
6868

69+
- Issue #24608: chunk.Chunk.read() now always returns bytes, not str.
70+
6971
- Issue #18684: Fixed reading out of the buffer in the re module.
7072

7173
- Issue #24259: tarfile now raises a ReadError if an archive is truncated

0 commit comments

Comments
 (0)