Does the documentation mean what it says? The 3.1 library reference says quopri.encodestring takes a string, but feeding it a string results in an error.
quopri.encodestring(s[, quotetabs])
Like encode(), except that it accepts a source string and returns the corresponding encoded string.
However, feeding this a str results in an error
import quopri
enctext = quopri.encodestring('hello')
print(enctext)
results in
TypeError: argument 1 must be bytes or buffer, not str.
??