[IronPython] An error using cPickle

Vizcayno Tamparantan vizcaynot at gmail.com
Mon Sep 17 05:16:31 CEST 2007


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://mail.python.org/pipermail/ironpython-users/attachments/20070916/bebf88b8/attachment.html>


More information about the Ironpython-users mailing list