[issue21200] pkgutil.get_loader() fails on "__main__"

2014-04-18 Thread Eric Snow
Eric Snow added the comment: The change is pretty minor so I went ahead and pushed it. To be honest, we should consider deprecating both get_loader and find_loader. I'm just not going to worry about it right now. :) -- resolution: -> fixed stage: patch review -> resolved status: ope

[issue21200] pkgutil.get_loader() fails on "__main__"

2014-04-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset bc4eb1b3db5d by Eric Snow in branch '3.4': Issue #21200: Return None from pkgutil.get_loader() when __spec__ is missing. http://hg.python.org/cpython/rev/bc4eb1b3db5d -- nosy: +python-dev ___ Python track

[issue21200] pkgutil.get_loader() fails on "__main__"

2014-04-13 Thread Eric Snow
Eric Snow added the comment: I've opened #21211 to more directly address the find_loader() issue. -- ___ Python tracker ___ ___ Python

[issue21200] pkgutil.get_loader() fails on "__main__"

2014-04-13 Thread Eric Snow
Eric Snow added the comment: Here's a patch that checks for modules that don't have __spec__ set. The patch will fix the problem. However note that the docs and docstring imply (to me) that we should turn any ImportError coming out of the find_loader() call into returning None. Fixing that w

[issue21200] pkgutil.get_loader() fails on "__main__"

2014-04-11 Thread Eric Snow
New submission from Eric Snow: Prior to 3.4, pkgutil.get_loader('__main__') would return None. Now it results in an ImportError. That's because it calls importlib.util.find_spec() which fails if an existing module does not have __spec__ or it is None. -- components: Library (Lib) key