Stefan Rank wrote: > Well, originally, I would have expected it to return a byte str(ing), I'd assume unicode in, unicode out, and str in, str out, but since it's always going to produce ASCII-range characters, it wouldn't matter. Moot point anyway. > BUT > I am now converted and think it is best to raise a TypeError for > unicode, and leave the encoding decisions to higher level code. > > So I'll repeat the "patch" #1, slightly modified:: > > if isinstance(s, unicode): > raise TypeError("quote expects an encoded byte string as argument") > > Is it safe to assume that code that breaks because of this change was > already broken? Yes. The patch seems fine to me, although maybe if not isinstance(s, str) would be better?
RetroSearch is an open source project built by @garambo | Open a GitHub Issue
Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo
HTML:
3.2
| Encoding:
UTF-8
| Version:
0.7.4