[IronPython] An error using cPickle
Dino Viehland
dinov at exchange.microsoft.com
Mon Sep 17 08:42:39 PDT 2007
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: users-bounces at lists.ironpython.com [mailto:users-bounces at lists.ironpython.com] On Behalf Of Vizcayno Tamparantan
Sent: Sunday, September 16, 2007 8:17 PM
To: users at lists.ironpython.com
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?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.ironpython.com/pipermail/users-ironpython.com/attachments/20070917/005d7542/attachment.html
More information about the Users
mailing list