This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Ronan.Lamy
Recipients Ronan.Lamy, brett.cannon, docs@python, ncoghlan
Date 2012-07-29.02:55:09
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1343530510.61.0.113197969687.issue15482@psf.upfronthosting.co.za>
In-reply-to
Content
I noticed a change in the behaviour of __import__() between 3.2 and 3.3. It looks like in 3.2 __import__() does a Py2-style combo relative/absolute import. Here's a minimal test case:

$ ls foo
bar.py  __init__.py  __pycache__
$ cat foo/__init__.py
__import__('bar', globals(), locals())
$ python3.3 -c "import foo"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "./foo/__init__.py", line 1, in <module>
    __import__('bar', globals(), locals())
ImportError: No module named 'bar'
$ python3.2 -c "import foo"
$

I believe that 3.3 is correct and that 3.2 is wrong but can't be changed now, so I suppose that 3.2 should just document the actual behaviour of __import__() and 3.3 should document the change. 

(The context is that I encountered issue 15434. This looks related, but I'm not sure it is.)
History
Date User Action Args
2012-07-29 02:55:10Ronan.Lamysetrecipients: + Ronan.Lamy, brett.cannon, ncoghlan, docs@python
2012-07-29 02:55:10Ronan.Lamysetmessageid: <1343530510.61.0.113197969687.issue15482@psf.upfronthosting.co.za>
2012-07-29 02:55:09Ronan.Lamylinkissue15482 messages
2012-07-29 02:55:09Ronan.Lamycreate