Issue222804

classification
Title: cPickle bug in find_class method
Type: Severity: normal
Components: Library Versions:
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: bckfnn
Priority: low Keywords:

Created on 2000-11-18.18:58:25 by bckfnn, last changed 2000-11-18.22:10:05 by bckfnn.

Messages
msg45 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.18:58:25
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);
msg46 (view) Author: Finn Bock (bckfnn) Date: 2000-11-18.22:10:05
Fixed by using the supplied patch.
History
Date User Action Args
2000-11-18 18:58:25bckfnncreate