We haven't extended Pickle to support arbitrary (presumably serializable) .NET 
objects.  For that you'll need to use normal .NET serialization (if the object 
is serializable) or serialize this manually.

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Vizcayno 
Tamparantan
Sent: Sunday, September 16, 2007 8:17 PM
To: [email protected]
Subject: [IronPython] An error using cPickle

Hello:
>From my WIN XP SP2,
using: IronPython console: IronPython 2.0A4 (2.0.10904.02) on .NET 2.0.50727.42

I accessed to Active Directory data at my office in the next way:
import sys
import clr
import System
clr.AddReferenceByPartialName("System.DirectoryServices")
root=System.DirectoryServices.DirectoryEntry ()
s=System.DirectoryServices.DirectorySearcher()
s.Filter = "(cn=*smith*)"
s.SizeLimit = 1000
s.PageSize = 1000
r=s.FindAll()
r.Count  # Gives me 5 so, it worked

Now I want to Pickle variable r but get an error:
import cPickle
ad = open("actdir", "w")
cPickle.dump(r, ad)
Traceback (most recent call last):
  File , line 0, in ##234
  File , line 0, in _stub_##235
TypeError: default __new__ does not take parameters
What am I missing?

_______________________________________________
Users mailing list
[email protected]
http://lists.ironpython.com/listinfo.cgi/users-ironpython.com

Reply via email to