Skip to content

Commit

Permalink
Fixed __setstate__() and __getstate__() of ReconnectLDAPObject
Browse files Browse the repository at this point in the history
  • Loading branch information
stroeder committed Apr 19, 2003
1 parent 93a3c8f commit 3b6d52f
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions Demo/pickle_ldapobject.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import os,ldap,pickle

temp_file_name = os.path.join(os.environ.get('TMP','/tmp'),'pickle_ldap-%d' % (os.getpid()))

l1 = ldap.ldapobject.ReconnectLDAPObject('ldap://localhost:1390',trace_level=1)
l1.protocol_version = 3
l1.search_s('',ldap.SCOPE_BASE,'(objectClass=*)')

pickle.dump(l1,open(temp_file_name,'wb'))

l2 = pickle.load(open(temp_file_name,'rb'))
l2.search_s('',ldap.SCOPE_BASE,'(objectClass=*)')

0 comments on commit 3b6d52f

Please sign in to comment.