Message9996

Author jeff.allen
Recipients Arfrever, fwierzbicki, jeff.allen, tkanerva, zyasoft
Date 2015-05-03.20:04:06
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1430683447.22.0.304353675458.issue2158@psf.upfronthosting.co.za>
In-reply-to
Content
Fixed in my repo (which appears here as %jt%), to appear centrally soon:

1. Correct error identified:

> type a.py
from .b import *
> type b.py
The system cannot find the file specified.
> %jt%\dist\bin\jython -c"import a"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "a.py", line 1, in <module>
    from .b import *
ValueError: Attempted relative import in non-package

2. And of course b.py is not found:

> echo print "Hello from b" > b.py
> jython -c"import a"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "a.py", line 1, in <module>
    from .b import *
ValueError: Attempted relative import in non-package

3. in my variant:

> tree/f u
C:\ ... \U
│   y.py
│   __init__.py
│
└───v
    │   y.py
    │   __init__.py
    │
    └───w
            x.py
            y.py
            __init__.py

> type u\v\w\x.py
print("File: u\\v\\w\\x.py")
from ...y import *
> type u\y.py
print("File: u\\y.py")
> type u\v\w\y.py
print("File: u\\v\\w\\y.py")

... and so on: all the files print their path.

> %jt%\dist\bin\jython -c"import u.v.w.x"
Init: u\__init__.py
Init: u\v\__init__.py
Init: u\v\w\__init__.py
File: u\v\w\x.py
File: u\y.py

This shows we get the right y.py.

These are all fixed by getting the level parameter right in code generation. If you demonstrate the bug (which still exists in the released 2.7.0), you must clean up the class files before demonstrating the fixed version.
History
Date User Action Args
2015-05-03 20:04:07jeff.allensetmessageid: <1430683447.22.0.304353675458.issue2158@psf.upfronthosting.co.za>
2015-05-03 20:04:07jeff.allensetrecipients: + jeff.allen, fwierzbicki, zyasoft, Arfrever, tkanerva
2015-05-03 20:04:07jeff.allenlinkissue2158 messages
2015-05-03 20:04:06jeff.allencreate