Message11325

Author stefan.richthofer
Recipients psterdale, stefan.richthofer
Date 2017-04-25.23:38:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1493163496.48.0.107044697609.issue2579@psf.upfronthosting.co.za>
In-reply-to
Content
> But in production my modules and pyc files will be added to class path.

Once a class file for an oversize-issued module has been successfully created (e.g. ucsmeta$py.class), the pyc files are not required any more; the CPython bytecode gets embedded into the classfile. So you only need to distribute classfiles. Under some circumstances Jython does not write the classfiles to disc. In that case you can enforce classfile creation as follows:

Write a script (e.g. compile_ucsmeta.py) like

import compileall, sys
sys.path.append('dir_containing_oversize_issued_module') # so it's workable with current pyc-file search mechanism
compileall.compile_dir('dir_containing_oversize_issued_module')

Run it e.g. like this
java -cp .:jython-standalone.jar:your_classpath org.python.util.jython


That said, I agree we need a proper fix for this issue.
I improved the previous attempt in
https://github.com/Stewori/jython/commit/9d45e3979ad82f86a65a46e33d80ca3fa7261f4d

and successfully tested it as far as I was able to reproduce your scenario. Please test my fork at
https://github.com/Stewori/jython
again regarding this issue.
Especially the NullPointerException if no pyc-file exists was fixed; now it should print the usual instructions.
It should adjust the filename to a version not containing __pyclasspath__, but the actual path.

Regarding your result with
ImportError: No module named ucsmsdk.ucsmeta

I get output like this if classpath is not properly set. If you continue to see this, please sketch your import hierarchy w.r.t classpath configuration, so I can reproduce.
History
Date User Action Args
2017-04-25 23:38:16stefan.richthofersetmessageid: <1493163496.48.0.107044697609.issue2579@psf.upfronthosting.co.za>
2017-04-25 23:38:16stefan.richthofersetrecipients: + stefan.richthofer, psterdale
2017-04-25 23:38:16stefan.richthoferlinkissue2579 messages
2017-04-25 23:38:15stefan.richthofercreate