Skip to content

Commit c2e91f8

Browse files
committed
Fixes GH43540
1 parent 011c016 commit c2e91f8

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pandas/io/common.py

+2-1
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,8 @@ def read(self, size: int = -1) -> str | bytes:
877877
if self.decode:
878878
# memory mapping is applied before compression. Encoding should
879879
# be applied to the de-compressed data.
880-
return content.decode(self.encoding, errors=self.errors)
880+
final: bool = len(content) == 0
881+
return self.decoder.decode(content, final=final)
881882
return content
882883

883884
def __next__(self) -> str:

0 commit comments

Comments
 (0)