summaryrefslogtreecommitdiff
path: root/paramiko/sftp_attr.py
diff options
context:
space:
mode:
Diffstat (limited to 'paramiko/sftp_attr.py')
-rw-r--r--paramiko/sftp_attr.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py
index 5597948a..ea12b2f6 100644
--- a/paramiko/sftp_attr.py
+++ b/paramiko/sftp_attr.py
@@ -82,7 +82,7 @@ class SFTPAttributes (object):
return attr
def __repr__(self):
- return '<SFTPAttributes: %s>' % self._debug_str()
+ return '<SFTPAttributes: {}>'.format(self._debug_str())
# ...internals...
@classmethod
@@ -146,15 +146,15 @@ class SFTPAttributes (object):
def _debug_str(self):
out = '[ '
if self.st_size is not None:
- out += 'size=%d ' % self.st_size
+ out += 'size={} '.format(self.st_size)
if (self.st_uid is not None) and (self.st_gid is not None):
- out += 'uid=%d gid=%d ' % (self.st_uid, self.st_gid)
+ out += 'uid={} gid={} '.format(self.st_uid, self.st_gid)
if self.st_mode is not None:
out += 'mode=' + oct(self.st_mode) + ' '
if (self.st_atime is not None) and (self.st_mtime is not None):
- out += 'atime=%d mtime=%d ' % (self.st_atime, self.st_mtime)
+ out += 'atime={} mtime={} '.format(self.st_atime, self.st_mtime)
for k, v in self.attr.items():
- out += '"%s"=%r ' % (str(k), v)
+ out += '"{}"={!r} '.format(str(k), v)
out += ']'
return out
@@ -222,8 +222,12 @@ class SFTPAttributes (object):
if size is None:
size = 0
+ # TODO: not sure this actually worked as expected beforehand, leaving
+ # it untouched for the time being, re: .format() upgrade, until someone
+ # has time to doublecheck
return '%s 1 %-8d %-8d %8d %-12s %s' % (
- ks, uid, gid, size, datestr, filename)
+ ks, uid, gid, size, datestr, filename,
+ )
def asbytes(self):
return b(str(self))