Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
From 738e9291ed15980bdac568fc5f9507a43897ba52 Mon Sep 17 00:00:00 2001
From: Kyle Manna <>
Date: Fri, 6 Nov 2015 08:12:50 -0800
Subject: [PATCH] obnamlib: sftp: Add prefetch size argument
Paramiko made this argument required in v1.16. Details at
Attempt to fetch the entire file. I'm unsure if this is the original
intent. If the entire file isn't to be fetched, then the prefetch() is
probably not needed.
obnamlib/plugins/ | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/obnamlib/plugins/ b/obnamlib/plugins/
index c4d5c2f..a5bc72b 100644
--- a/obnamlib/plugins/
+++ b/obnamlib/plugins/
@@ -555,7 +555,7 @@ class SftpFS(obnamlib.VirtualFileSystem):
def cat(self, pathname):
f =, 'rb')
- f.prefetch()
+ f.prefetch(self.lstat(pathname).st_size)
chunks = []
while True:
chunk =
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.