Skip to content

Commit a81f545

Browse files
committed
use bytes_read variable in readinto methods
1 parent c9d71f2 commit a81f545

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

fs/ftpfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ def readinto(self, buffer):
239239
# type: (bytearray) -> int
240240
data = self.read(len(buffer))
241241
bytes_read = len(data)
242-
buffer[: len(data)] = data
242+
buffer[:bytes_read] = data
243243
return bytes_read
244244

245245
def readline(self, size=-1):

fs/iotools.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@ def readinto(self, b):
117117
except AttributeError:
118118
data = self._f.read(len(b))
119119
bytes_read = len(data)
120-
b[: len(data)] = data
120+
b[:bytes_read] = data
121121
return bytes_read
122122

123123
@typing.no_type_check
@@ -128,7 +128,7 @@ def readinto1(self, b):
128128
except AttributeError:
129129
data = self._f.read1(len(b))
130130
bytes_read = len(data)
131-
b[: len(data)] = data
131+
b[:bytes_read] = data
132132
return bytes_read
133133

134134
def readline(self, limit=-1):

0 commit comments

Comments
 (0)