@@ -51,7 +51,7 @@ The :rfc:`4648` encodings are suitable for encoding binary data so that it can b
5151safely sent by email, used as parts of URLs, or included as part of an HTTP
5252POST request.
5353
54- .. function :: b64encode(s, altchars=None)
54+ .. function :: b64encode(s, altchars=None, *, wrapcol=0 )
5555
5656 Encode the :term: `bytes-like object ` *s * using Base64 and return the encoded
5757 :class: `bytes `.
@@ -61,9 +61,16 @@ POST request.
6161 This allows an application to e.g. generate URL or filesystem safe Base64
6262 strings. The default is ``None ``, for which the standard Base64 alphabet is used.
6363
64+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
65+ after at most every *wrapcol * characters.
66+ If *wrapcol * is zero (default), do not insert any newlines.
67+
6468 May assert or raise a :exc: `ValueError ` if the length of *altchars * is not 2. Raises a
6569 :exc: `TypeError ` if *altchars * is not a :term: `bytes-like object `.
6670
71+ .. versionchanged :: 3.15
72+ Added the *wrapcol * parameter.
73+
6774
6875.. function :: b64decode(s, altchars=None, validate=False)
6976
@@ -214,9 +221,9 @@ Refer to the documentation of the individual functions for more information.
214221 instead of 4 consecutive spaces (ASCII 0x20) as supported by 'btoa'. This
215222 feature is not supported by the "standard" Ascii85 encoding.
216223
217- *wrapcol * controls whether the output should have newline (``b'\n' ``)
218- characters added to it. If this is non-zero, each output line will be
219- at most this many characters long, excluding the trailing newline .
224+ If *wrapcol * is non-zero, insert a newline (``b'\n' ``) character
225+ after at most every * wrapcol * characters.
226+ If * wrapcol * is zero (default), do not insert any newlines .
220227
221228 *pad * controls whether the input is padded to a multiple of 4
222229 before encoding. Note that the ``btoa `` implementation always pads.
@@ -278,7 +285,7 @@ Refer to the documentation of the individual functions for more information.
278285
279286 .. versionadded :: 3.13
280287
281- .. versionchanged :: next
288+ .. versionchanged :: 3.15
282289 The *pad * parameter was added.
283290
284291
0 commit comments