Message 155440 - Python tracker
Just a minor comment on the patch - It should be %r instead of %s.
- raise TypeError('must be str, not %s' % type(s))
+ raise TypeError('must be str, not %r' % type(s))
If there is any test for this, it could be added. I find this approach 'OK'.