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 serhiy.storchaka
Recipients Julian.Gindi, Tim.Graham, berker.peksag, bignose, brett.cannon, davidszotten@gmail.com, eric.snow, ezio.melotti, ncoghlan, rhettinger, serhiy.storchaka
Date 2016-10-12.10:22:14
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <5294611.08LeiyhfGk@xarax>
In-reply-to <1476266022.79.0.312830417372.issue21720@psf.upfronthosting.co.za>
Content
> How about raising a TypeError if ``all(isinstance(l, str) for l in
> fromlist)`` is False? That would make the exception message less clearer
> since we can't include the "[...] not 'bytes'" part though.

    for l in fromlist:
        if not isinstance(l, str):
            raise TypeError(...)

Note also that you can get an arbitrary error if fromlist is not a sequence.

Actually this issue doesn't look very important for Python 3, since it is 
unlikely that non-string is passed in fromlist. Unlike to Python 2 where you 
can pass unicode if just use unicode_literals. Other solution for Python 2 is 
allowing unicode in fromlist. Perhaps this would increase compatibility with 
Python 3.
History
Date User Action Args
2016-10-12 10:22:15serhiy.storchakasetrecipients: + serhiy.storchaka, brett.cannon, rhettinger, ncoghlan, ezio.melotti, bignose, eric.snow, berker.peksag, Julian.Gindi, davidszotten@gmail.com, Tim.Graham
2016-10-12 10:22:14serhiy.storchakalinkissue21720 messages
2016-10-12 10:22:14serhiy.storchakacreate