flying-circus / pyfilesystem

Automatically exported from code.google.com/p/pyfilesystem
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

SFTPFS is not pickable #115

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
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 ad...@dmarkey.com on 8 May 2012 at 4:19

GoogleCodeExporter commented 9 years ago
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