[Zope] Error Value: can't pickle function objects

Mohamed Lrhazi mohamed at your-site.com
Fri May 28 13:15:25 EDT 2004


When I replace :

self.domain = self.ddb.getDomain(REQUEST['YSURLARGS'][1])
self.domainTitle=self.domain.getHTMLDomainName()

with this:

domain = self.ddb.getDomain(REQUEST['YSURLARGS'][1])
self.domainTitle=domain.getHTMLDomainName()

It works.

"domain" above is an instance of a class called Domain, I defined it in a 
module that lives in /usr/local/zope/lib/python/YSDomain and that does not 
implement nor extend any Zope classes or interfaces...

Why does instantiating such an object inside my zope application cause 
"can't pickle function objects" error?


Thanks a lot.
Mohamed~



--On Friday, May 28, 2004 11:36 AM -0400 Mohamed Lrhazi 
<mohamed at your-site.com> wrote:

> What does that error mean?
>
> In my main class I have :
>
>
> main_page=PageTemplateFile('zpt/main_page.zpt',globals())
> main_page._owner=None
>
> 	
>   def index_html(self,REQUEST=None):
> 	"""our main page... Enter here!"""
> 	if REQUEST is not None:
> 		if REQUEST.has_key('YSURLARGS'):
> 			if REQUEST['YSURLARGS'][0] == 'domain':
> 				self.domain = self.ddb.getDomain(REQUEST['YSURLARGS'][1])
> 				self.domainTitle=self.domain.getHTMLDomainName()
> 			else:
> 				pass
> 		else:
> 			pass
> 	else:
> 		pass
> 	return self.main_page(self,REQUEST)
>
>
> And this results in:
>
> Site Error
> An error was encountered while publishing this resource.
>
> Error Type: TypeError
> Error Value: can't pickle function objects
>
>
>
>
> _______________________________________________
> Zope maillist  -  Zope at zope.org
> http://mail.zope.org/mailman/listinfo/zope
> **   No cross posts or HTML encoding!  **
> (Related lists -  http://mail.zope.org/mailman/listinfo/zope-announce
>  http://mail.zope.org/mailman/listinfo/zope-dev )







More information about the Zope mailing list