From 0694a2e8c7d64226b8da3c92a8352986f10100db Mon Sep 17 00:00:00 2001 From: Ryan Tucker Date: Wed, 6 Jan 2010 09:03:08 -0500 Subject: [PATCH] stringio does not have a fastread... --- BackupPC_archiveHost_s3 | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/BackupPC_archiveHost_s3 b/BackupPC_archiveHost_s3 index d6c3abc..f3cf27d 100755 --- a/BackupPC_archiveHost_s3 +++ b/BackupPC_archiveHost_s3 @@ -48,10 +48,16 @@ class MyKey(Key): @return: MD5 Hash of the file in fp """ m = md5.new() - s = fp.fastread(self.BufferSize) + try: + s = fp.fastread(self.BufferSize) + except AttributeError: + s = fp.read(self.BufferSize) while s: m.update(s) - s = fp.fastread(self.BufferSize) + try: + s = fp.fastread(self.BufferSize) + except AttributeError: + s = fp.read(self.BufferSize) self.md5 = m.hexdigest() self.base64md5 = base64.encodestring(m.digest()) if self.base64md5[-1] == '\n':