Author mhagger
Recipients curtis, edanuff, mhagger, niall_kelly, ttsounis
Date 2011-05-04.17:03:24
SpamBayes Score 1.59213e-10
Marked as misclassified No
Message-id <>
In either 2.2.1 or in 2.6a0+ (trunk r7292) I am usually successful importing from a mixed directory.  But in both of those versions I see an ImportError in the following, more specific scenario.  When the current directory contains the following files:


then importing Foo fails with an ImportError; e.g., when run via

    jython -c 'from a.b import Foo'


    jython -c 'import a.b.Foo'

However, if I add a file a/Foobar.class, then both of the imports succeed.

The problem seems to be in org.python.core.packagecache.PathPackageManager.  In particular, there seems to be an assumption in PackageExistsFileFilter that a directory is pure Python if it includes Python code but no Java code, even if one of its subdirectories includes Java code.

I will attach a tar file that illustrates the problem; simply unpack it in a clean directory then run one of the jython commands as shown above.  The tarball also includes some scripts for playing around with variations on the theme.  Let me know if you need more information.
Date User Action Args
2011-05-04 17:03:25mhaggersetmessageid: <>
2011-05-04 17:03:25mhaggersetrecipients: + mhagger, niall_kelly, curtis, ttsounis, edanuff
2011-05-04 17:03:25mhaggerlinkissue1878866 messages
2011-05-04 17:03:24mhaggercreate