On Mon, Dec 15, 2014 at 1:29 AM, Ben Finney <ben+pyt...@benfinney.id.au> wrote: > How can I get that ‘__import__’ call, complete with its ‘fromlist’ > parameter, working correctly under both Python 2 and Python 3, keeping > the ‘unicode_literals’ setting?
How about "str('bar')"? > If some kind of kludge is needed to make it work between versions, is > this a bug which should be fixed so “use Unicode for text” remains > applicable advice? Fixed in which version? The problem is that Python 2 mixes the notions of strings and bytestrings, and the solution is Python 3. I believe six also has a "give me a native string" function to help with this. -- Zach -- https://mail.python.org/mailman/listinfo/python-list