Message12076

Author jeff.allen
Recipients jeff.allen, spaceman_spiff, stefan.richthofer
Date 2018-08-10.19:47:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1533930434.86.0.56676864532.issue2700@psf.upfronthosting.co.za>
In-reply-to
Content
I notice that testModule (TestModule) is differently capitalised here and there and that we are on Windows. I think Jython will make some attempt to ignore case when finding files on Windows, but it won't ignore case internally.

With exactly the capitalisation shown I get:

PS 271-sa> python ModuleA.py
Traceback (most recent call last):
  File "ModuleA.py", line 1, in <module>
    import TestModule
  File "C:\Users\Jeff\Documents\Jython\271-sa\TestModule\__init__.py", line 1, in <module>
    import test_file
  File "C:\Users\Jeff\Documents\Jython\271-sa\TestModule\test_file.py", line 1, in <module>
    import testModule
ImportError: No module named testModule
PS 271-sa> java -Xmx512m -Xss2560k -cp "C:\Jython\2.7.1-sa\jython-standalone-2.7.1.jar" org.python.util.jython ModuleA.py
Traceback (most recent call last):
  File "ModuleA.py", line 1, in <module>
    import TestModule
  File "C:\Users\Jeff\Documents\Jython\271-sa\TestModule\__init__.py", line 1, in <module>
    import test_file
  File "C:\Users\Jeff\Documents\Jython\271-sa\TestModule\test_file.py", line 1, in <module>
    import testModule
ImportError: No module named testModule

Now with the latest Jython I get:

PS 271-sa> java -Xmx512m -Xss2560k -cp "C:\Users\Jeff\.m2\repository\org\python\jython\2.7.2a1+\jython-2.7.2a1+.jar;.\extlibs\*;"  org.python.util.jython ModuleA.py
TESTPROP: 0
TESTPROP: 1
TESTPROP: 1
TESTPROP: 1

But I can't help thinking that's not right, maybe because it is "differently tolerant" of capitalisation. With consistent capitalisation I get:

PS 271-sa> python ModuleA.py
TESTPROP: False
TESTPROP: True
PS 271-sa> java -Xmx512m -Xss2560k -cp "C:\Jython\2.7.1-sa\jython-standalone-2.7.1.jar" org.python.util.jython ModuleA.py
TESTPROP: 0
TESTPROP: 1
PS 271-sa> java -Xmx512m -Xss2560k -cp "C:\Users\Jeff\.m2\repository\org\python\jython\2.7.2a1+\jython-2.7.2a1+.jar;.\extlibs\*;"  org.python.util.jython ModuleA.py
TESTPROP: 0
TESTPROP: 1

This looks right to me, except that it illustrates #2691.
History
Date User Action Args
2018-08-10 19:47:14jeff.allensetmessageid: <1533930434.86.0.56676864532.issue2700@psf.upfronthosting.co.za>
2018-08-10 19:47:14jeff.allensetrecipients: + jeff.allen, stefan.richthofer, spaceman_spiff
2018-08-10 19:47:14jeff.allenlinkissue2700 messages
2018-08-10 19:47:14jeff.allencreate