classification
Title: str.encode('base64') add trailing new line character. It is not documented.
Type: enhancement Stage: resolved
Components: Documentation Versions: Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: ezio.melotti Nosy List: alex.75, dmi.baranov, docs@python, ezio.melotti, python-dev
Priority: normal Keywords: patch

Created on 2013-04-13 15:39 by alex.75, last changed 2013-05-07 08:21 by python-dev. This issue is now closed.

Files
File name Uploaded Description Edit
issue17714.patch dmi.baranov, 2013-04-29 20:00 review
Messages (5)
msg186734 - (view) Author: Alessandro Piccione (alex.75) Date: 2013-04-13 15:39
str.encode() with 'base64' as argument add a trailing new line character to the returned string. This is the difference from base64.b64encode(str) (that is used internally).

This is not documented in str.encode()
http://docs.python.org/2/library/stdtypes.html?highlight=encode#str.encode

Instead it is perfectly documented for base64.encodestring()
http://docs.python.org/2/library/base64.html#base64.encodestring
msg188091 - (view) Author: Dmi Baranov (dmi.baranov) * Date: 2013-04-29 20:00
Added a patch
msg188632 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-07 08:14
New changeset 8b764c3521fa by Ezio Melotti in branch '2.7':
#17714: document that the base64 codec adds a trailing newline.
http://hg.python.org/cpython/rev/8b764c3521fa
msg188633 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-05-07 08:16
The str.encode() doc is the wrong place where to document this, since the '\n' is added only for the base64 codec.  I added a note about this in the codecs docs[0].

[0]: http://docs.python.org/2/library/codecs.html#standard-encodings
msg188634 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-05-07 08:21
New changeset cbb23e40e0d7 by Ezio Melotti in branch '3.3':
#17714: document that the base64 codec adds a trailing newline.
http://hg.python.org/cpython/rev/cbb23e40e0d7

New changeset b3e1be1493a5 by Ezio Melotti in branch 'default':
#17714: merge with 3.3.
http://hg.python.org/cpython/rev/b3e1be1493a5
History
Date User Action Args
2013-05-07 08:21:33python-devsetmessages: + msg188634
2013-05-07 08:16:56ezio.melottisetstatus: open -> closed
messages: + msg188633

assignee: docs@python -> ezio.melotti
resolution: fixed
stage: patch review -> resolved
2013-05-07 08:14:38python-devsetnosy: + python-dev
messages: + msg188632
2013-04-30 07:38:48ezio.melottisetnosy: + ezio.melotti

type: enhancement
stage: needs patch -> patch review
2013-04-29 20:00:47dmi.baranovsetfiles: + issue17714.patch

nosy: + dmi.baranov
messages: + msg188091

keywords: + patch
2013-04-19 18:59:27terry.reedysetassignee: docs@python

nosy: + docs@python
components: + Documentation
stage: needs patch
2013-04-13 15:39:53alex.75settitle: str.encode('base64') add trailing new line character is not documented -> str.encode('base64') add trailing new line character. It is not documented.
2013-04-13 15:39:29alex.75create