# HG changeset patch # Parent d4b68ac6c4eaf51dd06a339a16f188737199c78e Issue #25495: Clarify data length limit for b2a_base64() diff -r d4b68ac6c4ea Doc/library/binascii.rst --- a/Doc/library/binascii.rst Tue Nov 03 22:43:31 2015 -0800 +++ b/Doc/library/binascii.rst Thu Nov 05 10:57:14 2015 +0000 @@ -9,7 +9,7 @@ .. index:: module: uu - module: base64 + single: base 64 module: binhex The :mod:`binascii` module contains a number of methods to convert between @@ -45,8 +45,11 @@ .. function:: b2a_base64(data) Convert binary data to a line of ASCII characters in base64 coding. The return - value is the converted line, including a newline char. The length of *data* - should be at most 57 to adhere to the base64 standard. + value is the converted line, including a newline char. + + The *base64* encoding for MIME (:rfc:`2045`) requires each encoded line + to be no more than 76 characters long (exactly 57 bytes of input data per + line). However, other uses of base-64 encoding do not have this limit. .. function:: a2b_qp(string[, header]) @@ -165,7 +168,7 @@ .. seealso:: Module :mod:`base64` - Support for base64 encoding used in MIME email messages. + Support for encoding in base 16, 32 and 64. Module :mod:`binhex` Support for the binhex format used on the Macintosh.