Originally reported by: James Cleveland (Bitbucket: radiosilence, GitHub: radiosilence)
Code:
import six; six.u(u'bawbag')
Error:
TypeError: decoding Unicode is not supported
I would suggest adding this in the u(s) function:
if isinstance(s, unicode):
return s
So that it behaves like the unicode() function, IE: liberal in what you accept, conservative in what you produce.
- Bitbucket: https://bitbucket.org/gutworth/six/issue/45
该提问来源于开源项目:benjaminp/six