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 brett.cannon
Recipients Trundle, alex, benjamin.peterson, brett.cannon, eric.araujo, eric.smith, eric.snow, ncoghlan, pitrou, python-dev, roger.serwy, vstinner
Date 2012-04-15.00:53:23
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1334451204.73.0.794958712811.issue2377@psf.upfronthosting.co.za>
In-reply-to
Content
I committed the fix. Thanks for testing, Roger.

As for the change in semantics, I'm fully aware it is not backwards-compatible. Unfortunately the incorrect usage was not even discovered until I started my bootstrap work because the import statement does the right thing but __import__() itself was never updated so it is only noticeable if you never updated your code to use importlib.import_module() which has been the preferred way to programmatically import code since Python 2.7/3.1. Plus the correct semantics are documented in PEP 328 (http://python.org/dev/peps/pep-0328/) and referenced in the language spec (http://docs.python.org/py3k/reference/simple_stmts.html#the-import-statement) so I'm not going to change it back since this brings the function more in line with expectations. And since the fix is as simple as a try/except and two import calls then it falls within the realm of having to fix code for any new Python release.

And as for the crash, I will have a look.
History
Date User Action Args
2012-04-15 00:53:24brett.cannonsetrecipients: + brett.cannon, ncoghlan, pitrou, vstinner, eric.smith, benjamin.peterson, roger.serwy, eric.araujo, alex, Trundle, python-dev, eric.snow
2012-04-15 00:53:24brett.cannonsetmessageid: <1334451204.73.0.794958712811.issue2377@psf.upfronthosting.co.za>
2012-04-15 00:53:24brett.cannonlinkissue2377 messages
2012-04-15 00:53:23brett.cannoncreate