<div dir="ltr"><div><div><div><div><div><div><div><div><div>I have a project in which various modules need to import a particular module "util" which has the following content:<br><br></div><div>    # util.py<br>
</div><div>    class FooMaster(pb.Cacheable):<br>        ...<br><br></div><div>    class FooSlave(pb.RemoteCache):<br>        ...<br></div><div><br></div>    pb.setUnjellyableForClass(FooMaster, FooSlave)<br><br></div>Module "server" lives in the same directory as util and imports it like this<br>
</div>    # server.py<br></div><div>    import util<br><br></div>Module clent lives in an entirely different directory and imports util like this<br></div><div>    # client.py<br></div>    import myproject.path.to.some.files.util as util<br>
<br></div>This leads to the infamous insecureJelly exception because the name of the FooMaster class winds up being different due to the different import statements. Specifically, server's copy of pb registers it as<br>
<br>"util.FooMaster"<br><br>but client's copy registers it as<br><br>"myproject.path.to.some.files.util.FooMaster"<br><br></div>1. Is it a bug that pb cares about how something was imported when registering unjellyable classes?<br>
</div>2. If not, how am I supposed to work around this?<br></div>3. The problem goes away if I use the long, fully qualified import statement everywhere. Is that what I'm supposed to do?<br clear="all"><div><div><div>
<div><div><div><div><div><div><div><div><div><br></div><div>I read the howto and the on Stackoverflow question I could find regarding this issue. In both cases, it says to not define names in a main file precisely to avoid this issue, but not what to do in my case.<br>
</div><div><br></div><div>Thank you for any advice.<br></div><div><br>-- <br>Daniel Sank<br>Department of Physics<br>Broida Hall<br>University of California<br>Santa Barbara, CA 93117<br>(805)893-3899
</div></div></div></div></div></div></div></div></div></div></div></div></div>