Jim Baker added the comment:
I just worked on standalone support for #2196, and this gave me some fresh insight.
The best approach likely is to provide a new Clamp-specific runner similar to org.python.util.JarRunner. Let's assume a name like org.python.tools.ClampRunner. Clamp currently packs Lib files under /Lib in the jar so they can be used by existing but limited standalone support (see PySystemState#isStandalone for some specifics). Instead ClampRunner will unpack these files to a temporary directory (using the Java 7 support, Files#createTempDirectory), ensuring these are all deleted upon exit (File#deleteOnExit). Then it will call PySystemState#initialize with python.path property set to this unpacked directory.
Because it's a true directory, we will get standard file introspection that caused this bug to be submitted in the frist place.
Note that will also make it feasible to support the package cache using a similar scheme (python.cachedir property setting).
Lastly, this can be done completely outside of the Jython 2.7 dev cycle, but instead in Clamp instead. (Still need to verify that package cache can be constructed without such changes, but it can certainly be used without.)
Jython tracker <email@example.com>