[Zope] external methods and pyc files

Paul Winkler pw_lists at slinkp.com
Fri Feb 6 12:23:27 EST 2004


On Fri, Feb 06, 2004 at 04:18:56PM +0000, Richard Jolly wrote:
> If the .py files are in the Extensions folder, then this works fine. If, 
> however, only the .pyc files are in, then I get the same behaviour as 
> before. It appears that the wrong method is called - however perhaps the 
> right method (by name) is called, but the wrong code is associated with 
> it, because it can't be loaded from the .pyc file or some such. Can the 
> reload be silently failing for a pyc file?

Are you sure those .pyc files are correct?
I believe Zope doesn't normally write .pyc files for external methods.
 
> These errors are triggered by the call to the second external method 
> sharing the same function name that is called. It doesn't matter which 
> is called first, but when the second is called, it fails and will 
> consistently fail from then on.
> 
> There is another wrinkle.
> 
> There are two identically named functions in the .py files. One of these 
> is unused.
> 
> Root
>  A/
>    methx_strange
>      id = methx_strange
>      module = foo.py
>      name = strange
>   B/
>    other external methods
> 
> foo.py
>   def strange
> 
> bar.py
>   def strange
> 
> On occaision bar.py's strange method is called. How can this be?
> 
> I'm at a loss to explain this unless somehow the module name is not used.

Fortunately, that is not possible :-)
 
> I'm sure I don't understand half as much as I should. Is there an easy 
> way to get all information about the context/caller of an external method?

You could have the ext. method return str(REQUEST) as part of its output.
Maybe also self.getPhysicalPath() which should tell you something
about the calling context.
 
> Info I should have mentioned earlier:
> 	
> Zope Version Zope 2.3.2 (binary release, python 1.5.2, win32-x86)

You do realize that's three years old, right?
It is certainly possible that this is an old long-solved
bug, but I have no knowledge of that.

-- 

Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's NEGA CLOWN OF DISASTER!
(random hero from isometric.spaceninja.com)



More information about the Zope mailing list