Brett Cannon added the comment:

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.

----------
stage:  -> test needed
versions:  -Python 3.3, Python 3.4, Python 3.5

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue18018>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to