Message45

Author bckfnn
Recipients
Date 2000-11-18.18:58:25
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
cPickle module could not load nested modules.

e.g. module webJudge.engine.playMan could not be found when unpickling since
find_class
was supplying the wrong parameter to imp.importName.

Fixed by adding check for '.' in import name and supplying different parameters
to
import as required.

Patch Diff Below

D:\tmp\Python>diff cPickle-1.8\cPickle.java
unpatched\cPickle-1.8\cPickle.java
18c18
< package org.python.modules;
---
> //package org.python.modules;
1763,1768c1763
< //START OF GP PATCH
<               if(module.indexOf('.')==-1)
<                       env = imp.importName(module.intern(), true);
<               else
<                       env = imp.importName(module.intern(), false);
< //END OF GP PATCH
---
>               env = imp.importName(module.intern(), true);
History
Date User Action Args
2008-02-20 17:16:38adminlinkissue222804 messages
2008-02-20 17:16:38admincreate