jython instanates the wrong class loader
|Status:||Closed||Start date:||11 January 2014|
|Assignee:||Christophe Malgouyres||% Done:|
After importing django configuration (conf) and calling configure on the settings, configure fails with an error : AttributeError: ‘ClasspathPyImporter’ has no attribute ‘get_data’. When running the code below on jython in eclipse the correct class loader is instantiated namely ImpImporter. If the same test code is run in modelio then ClasspathPyImporter is instantiated. The problem only occurs when running jython in modelio. The error occurs on Windows 7 64 bit. I cannot test it on Linux as xulrunner gives problems.
import pkgutil for i in pkgutil.iter_importers('unicodedata'): print i.__class__ print i.find_module('unicodedata')
#1 Updated by Gerrie Myburgh almost 4 years ago
I think this can be closed.
The problem seems to be that jython pkgutil.py does not search in the jar file in the Lib location in the correct way. I am not sure if this a pyclasspath/Lib issue. I tried move the paths around in the sys.path list but to no effect.
A workaround is to insert a path int sys.path to some location on disk then change the jython.jar file name to jython.zip and extract the Lib folder to this location. Change the jython.zip name back to jython,jar and run modelio, Django (the python web framework) will now configure with no problem.