Message12778
There seems to be something broken with file handling in modules; below I isolated the problem:
- create a subfolder 'test'
- in the folder test, touch an __init__.py
- in the folder test, create a file 'trial.py' with the following contents:
from __future__ import print_function
def hello():
print('Hello world!')
Now run Jython:
java -Dpython.console -jar Jython-standalone-2.7.2b2.jar
>>> import test
>>> test.trial.hello()
Traceback (most recent call last):
File "<stdin>", line 1 in <module>
AttributeError: module' object has no attribute 'trial'
With Jython 2.7.1 (or 2.7.2a1):
java -Dpython.console -jar Jython-standalone-2.7.1.jar
>>> import test
>>> test.trial.hello()
Hello World!
>>>
Using Jython standalone on [Java HotSpot(TM) 64-Bit Server VM (Oracle Corporation)] on java1.8.0_231 / Windows 7 |
|
Date |
User |
Action |
Args |
2019-11-19 12:52:13 | ruud | set | recipients:
+ ruud |
2019-11-19 12:52:13 | ruud | set | messageid: <1574167933.15.0.698699708178.issue2832@roundup.psfhosted.org> |
2019-11-19 12:52:13 | ruud | link | issue2832 messages |
2019-11-19 12:52:12 | ruud | create | |
|