Message9438

Author Arfrever
Recipients Arfrever, fwierzbicki, tkanerva, zyasoft
Date 2015-01-21.23:59:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421884761.73.0.323129373674.issue2259@psf.upfronthosting.co.za>
In-reply-to
Content
This problem is absent without "from __future__ import absolute_import".

$ cd /tmp
$ mkdir test
$ touch test/__init__.py
$ echo $'from __future__ import absolute_import\nfrom . import *' > test/x.py
$ echo $'from __future__ import absolute_import\nfrom .z import *' > test/y.py
$ touch test/z.py
$ tree test
test
├── __init__.py
├── x.py
├── y.py
└── z.py

0 directories, 4 files
$ cat test/x.py
from __future__ import absolute_import
from . import *
$ cat test/y.py
from __future__ import absolute_import
from .z import *
$ python2.7 -c 'import test.x'
$ python2.7 -c 'import test.y'
$ jython2.7 -c 'import test.x'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "test/x.py", line 2, in <module>
    from . import *
ValueError: Empty module name
$ jython2.7 -c 'import test.y'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "test/y.py", line 2, in <module>
    from .z import *
ImportError: No module named z
$
History
Date User Action Args
2015-01-21 23:59:21Arfreversetrecipients: + Arfrever, fwierzbicki, zyasoft, tkanerva
2015-01-21 23:59:21Arfreversetmessageid: <1421884761.73.0.323129373674.issue2259@psf.upfronthosting.co.za>
2015-01-21 23:59:21Arfreverlinkissue2259 messages
2015-01-21 23:59:21Arfrevercreate