Issue 415694: binascii.b2a.base64() braindeadness - Python tracker (original) (raw)
Jim Fulton pointed out that binascii's b2a_base64() function restricts the length of its input to 57 characters for no good reason: the code would work for any input size but for this check. Also, there are situations where it makes sense not to append a newline, or to append something else than a newline.
Proposal:
get rid of the input size check
add an optional argument giving the delimiter string to be appended, defaulting to "\n"
possibly special-case None as the delimiter string to avoid adding the pad bytes too???