[Zope] external methods and pyc files
Paul Winkler
pw_lists at slinkp.com
Wed Feb 4 11:21:28 EST 2004
On Wed, Feb 04, 2004 at 12:20:17PM +0000, Richard Jolly wrote:
> Hi,
>
> I'm new to Zope, and I've inherited a project with a bug that I've been
> unable to solve for a couple of days. Please excuse any wrong-terminology.
>
> There is a zope installation, with two containers under the root folder.
> In each of these there is an external method having the same name,
> 'search'. On the public side of the site its clear that, on occaision,
> the wrong one of these external methods is called.
>
> Root
> A
> methx_search
> B
> methx_search
>
> The methx's contain sql statements pointing to different databases, and
> the error messages I get are sql errors ( 'no column ...' ), which is
> why its pretty clear which one is being called.
>
> I couldn't find any obvious reason why the wrong one was being called,
> but I found I could disambiguate the external methods by renaming them
> A_methx_search and B_methx_search in the ZMI, and saving the methods to
> reload them. This worked, albeit proving I don't understand the root of
> the problem, however...
It's almost certainly incorrect use of acquisition.
Can't say for sure without seeing how exactly you call these methods.
That's the problem with acquisition - it's easy to set up
something that *usually* works...
I would stick with your solution of using distinct names.
> The customer installation of this only includes the .pyc files that
> contain the external methods. When I try to rename and reload with the
> .pyc files only in the Extensions folder the problem does not get
> solved. When I remove the .pyc files and put the original .py files in
> place, everything works fine. What is going on?
ermm... no idea.
by the way, .pyc files don't protect your code very well,
if that's why you're shipping only them.
--
Paul Winkler
http://www.slinkp.com
Look! Up in the sky! It's JONIC LIMP BIMBO!
(random hero from isometric.spaceninja.com)
More information about the Zope
mailing list