From 4acb9589ced5a05d9f52f7fcb0f3f8630cb37c71 Mon Sep 17 00:00:00 2001 From: Robey Pointer Date: Thu, 7 Sep 2006 19:39:59 -0700 Subject: [project @ robey@lag.net-20060908023959-de70f0675f25fa64] fixes from mike barber for chdir and sftp attr __str__ --- paramiko/sftp_attr.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) (limited to 'paramiko/sftp_attr.py') diff --git a/paramiko/sftp_attr.py b/paramiko/sftp_attr.py index 6a861b5d..bdbda90d 100644 --- a/paramiko/sftp_attr.py +++ b/paramiko/sftp_attr.py @@ -86,9 +86,6 @@ class SFTPAttributes (object): def __repr__(self): return '' % self._debug_str() - def __str__(self): - return self._debug_str() - ### internals... @@ -210,5 +207,14 @@ class SFTPAttributes (object): else: datestr = time.strftime('%d %b %H:%M', time.localtime(self.st_mtime)) filename = getattr(self, 'filename', '?') - return '%s 1 %-8d %-8d %8d %-12s %s' % (ks, self.st_uid, self.st_gid, - self.st_size, datestr, filename) + + # not all servers support uid/gid + uid = self.st_uid + gid = self.st_gid + if uid is None: + uid = 0 + if gid is None: + gid = 0 + + return '%s 1 %-8d %-8d %8d %-12s %s' % (ks, uid, gid, self.st_size, datestr, filename) + -- cgit v1.2.1