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 Arfrever, Rosuav, auslander1970, brett.cannon, eric.snow, flox, fossilet, ncoghlan, pitrou
Date 2016-01-15.02:27:19
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1452824840.53.0.468364284808.issue18018@psf.upfronthosting.co.za>
In-reply-to
Content
The problem is in Python/import.c: https://hg.python.org/cpython/file/default/Python/import.c#l1453 . While the Python code has a check that `package` is a truthy value, the accelerated C code doesn't. Adding a check that the string isn't empty or truthy should do the trick as there seems to already be a check for None earlier.

The other question is whether this should change back to ValueError for Python 2 compatibility or turn into ImportError as Chris and Eric Snow have independently suggested?

Either way I'm only going to change this in Python 3.6 since the current semantics have been this way since Python 3.3, so it's beyond the realm of regression and into fixing a design mistake.
History
Date User Action Args
2016-01-15 02:27:20brett.cannonsetrecipients: + brett.cannon, ncoghlan, pitrou, fossilet, Arfrever, flox, eric.snow, Rosuav, auslander1970
2016-01-15 02:27:20brett.cannonsetmessageid: <1452824840.53.0.468364284808.issue18018@psf.upfronthosting.co.za>
2016-01-15 02:27:20brett.cannonlinkissue18018 messages
2016-01-15 02:27:19brett.cannoncreate