Message278330
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:12 | ncoghlan | set | recipients:
+ ncoghlan, brett.cannon, rhettinger, ezio.melotti, bignose, eric.snow, berker.peksag, Julian.Gindi, davidszotten@gmail.com, Tim.Graham |
2016-10-09 02:52:11 | ncoghlan | set | messageid: <1475981531.81.0.645193700737.issue21720@psf.upfronthosting.co.za> |
2016-10-09 02:52:11 | ncoghlan | link | issue21720 messages |
2016-10-09 02:52:10 | ncoghlan | create | |
|