[Zope] ImportError

Paul Winkler pw_lists at slinkp.com
Thu Aug 5 17:00:00 EDT 2004


Imports in through-the-web code are restricted.
You can only import modules that have been declared 
via Zope's security machinery.

To make these declarations, here's a little zopelabs recipe.
http://www.zopelabs.com/cookbook/1074897091

On Thu, Aug 05, 2004 at 08:08:28PM +0100, Simon Forster wrote:
> I reckon this must be a FAQ but I can't seem to find a sensible answer 
> anywhere. I'm getting a constant error of:
> 
> Error Type: ImportError
> Error Value: import of "Shared.AppleScript.test" is unauthorized
> 
> All I'm trying to do is import a trivial module from 
> (zope/lib/python/)Shared/AppleScript/test into a PythonScript in Zope. 
> Longer term I want to use a standard module which Zope will not give me 
> access to (os - so I sort of understand this) but at the mo I've 
> stripped the function down to just returning a string in order to get 
> things to work - except it's not.
> 
> Can I not import shared modules into an (internal top Zope) 
> PythonScript?
> 
> Please, help and pointers to appropriate documentation would be much 
> appreciated.
> 
> For now I give up!
> 
> TIA
> 
> Simon Forster
> _____________________________________________________
>  LDML Ltd, 62 Pall Mall, London, SW1Y 5HZ, UK
>  Tel: +44 (0)70 9230 5244   Fax: +44 (0)70 9230 5247
> _____________________________________________________
> 
> _______________________________________________
> 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 )

-- 

Paul Winkler
http://www.slinkp.com


More information about the Zope mailing list