Skip to content

Commit b2c69ce

Browse files
committed
A few last changes to account for changes from other branches
1 parent cc449e1 commit b2c69ce

2 files changed

Lines changed: 5 additions & 1 deletion

File tree

pytest_sftpserver/sftp/content_provider.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,10 @@ def get_size(self, path):
163163
try:
164164
return len(self.get(path, atime_change=False))
165165
except TypeError:
166+
# This casting to string is ok. If the value was a binary string
167+
# then we wouldn't have a TypeError anyway. This is just to
168+
# cast non-string-likes into a string to get a usable length.
169+
# FIXME: maybe report the data's memory size?
166170
return len(str(self.get(path, atime_change=False)))
167171

168172
def get_times(self, path):

pytest_sftpserver/sftp/interface.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ def chattr(self, attr):
4545
return SFTP_OK
4646

4747
def write(self, offset, data):
48-
content = self.content_provider.get(self.path)
48+
content = self.content_provider.get(self.path, atime_change=False)
4949

5050
if content is None:
5151
return SFTP_OK if self.content_provider.put(self.path, data) else SFTP_NO_SUCH_FILE

0 commit comments

Comments
 (0)