ktbs/ktbs — comment on commit 8f23cdf380218337702aedd8695b859a27f25302
File:  line 0
By oaubert:

To be (somehow) safe: I do not know how httplib handles non-ascii stuff.
The explicit conversion will avoid exceptions in the code, but can trigger strange bugs (since it will remove accented characters).
The best approach would be to find some real-world examples of URIs with non-ascii chars in them. It all depends on where you get your URI from: if it can be given by human, then there is a chance that there are invalid chars in it. In this case (and maybe generally), instead of the uri.encode approach, it would be better to use urllib.quote. But test for its unicode/str behaviour too.