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 Pavel.Aslanov
Recipients Arfrever, Pavel.Aslanov, brett.cannon, eric.araujo, ncoghlan
Date 2014-05-19.11:14:36
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1400498077.11.0.155830172287.issue14710@psf.upfronthosting.co.za>
In-reply-to
Content
This function is broken again in version 3.4

The way it should look is:
Python 2.7.6 (default, Feb 26 2014, 12:07:17) 
[GCC 4.8.2 20140206 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkgutil
>>> pkgutil.get_loader('no_such_module') # returns None
>>> 

How it really looks:
Python 3.4.0 (default, Apr 27 2014, 23:33:09) 
[GCC 4.8.2 20140206 (prerelease)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pkgutil
>>> pkgutil.get_loader('no_such_module')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.4/pkgutil.py", line 467, in get_loader
    return find_loader(fullname)
  File "/usr/lib/python3.4/pkgutil.py", line 488, in find_loader
    return spec.loader
AttributeError: 'NoneType' object has no attribute 'loader'
>>>

find_loader is at fault (change "return spec.loader" -> "return spec and spec.loader"). Thanks.
History
Date User Action Args
2014-05-19 11:14:37Pavel.Aslanovsetrecipients: + Pavel.Aslanov, brett.cannon, ncoghlan, eric.araujo, Arfrever
2014-05-19 11:14:37Pavel.Aslanovsetmessageid: <1400498077.11.0.155830172287.issue14710@psf.upfronthosting.co.za>
2014-05-19 11:14:37Pavel.Aslanovlinkissue14710 messages
2014-05-19 11:14:36Pavel.Aslanovcreate