pyfilesystem icon indicating copy to clipboard operation
pyfilesystem copied to clipboard

SFTPFS is not pickable

Open GoogleCodeExporter opened this issue 10 years ago • 1 comments

What steps will reproduce the problem?
1. Create an SFTP object using username and password
2. Try to pickle it
3. Try to load it. You will see an unpack error

This fixes it.

Index: fs/sftpfs.py
===================================================================
--- fs/sftpfs.py    (revision 787)
+++ fs/sftpfs.py    (working copy)
@@ -208,7 +208,7 @@
         state = super(SFTPFS,self).__getstate__()
         del state["_tlocal"]
         if self._owns_transport:
-            state['_transport'] = self._transport.getpeername()
+            state['_transport'] = self._transport.getpeername()[:2]
         return state

     def __setstate__(self,state):



Original issue reported on code.google.com by [email protected] on 8 May 2012 at 4:19

GoogleCodeExporter avatar Apr 11 '15 10:04 GoogleCodeExporter

Seems to work ok with trunk currently, without that change. I know its been a 
while but can you still reproduce it? 

Original comment by willmcgugan on 10 Sep 2013 at 9:33

GoogleCodeExporter avatar Apr 11 '15 10:04 GoogleCodeExporter