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 ncoghlan
Recipients Julian.Gindi, Tim.Graham, berker.peksag, bignose, brett.cannon,, eric.snow, ezio.melotti, ncoghlan, rhettinger
Date 2016-10-09.02:52:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <>
Berker's fix for Python 2.7 looks good to me.

However, Python 3 has a comparably vague error message, it's just inverted to complain about bytes rather than unicode due to the change in the native str type:

>>> __import__('encodings', fromlist=[b'aliases'])
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "<frozen importlib._bootstrap>", line 1013, in _handle_fromlist
TypeError: hasattr(): attribute name must be string

hasattr() in Python 2.7 is similarly unhelpful regarding what type it actually got when you give it something it doesn't expect.
Date User Action Args
2016-10-09 02:52:12ncoghlansetrecipients: + ncoghlan, brett.cannon, rhettinger, ezio.melotti, bignose, eric.snow, berker.peksag, Julian.Gindi,, Tim.Graham
2016-10-09 02:52:11ncoghlansetmessageid: <>
2016-10-09 02:52:11ncoghlanlinkissue21720 messages
2016-10-09 02:52:10ncoghlancreate