classification
Title: quopri: encodestring and decodestring handle bytes, not strings
Type: behavior Stage: patch review
Components: Documentation, email, Library (Lib) Versions: Python 3.4, Python 3.3, Python 3.2
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: docs@python Nosy List: barry, docs@python, patrick.vrijlandt, petri.lehtinen, r.david.murray
Priority: normal Keywords: needs review, patch

Created on 2012-08-08 07:30 by patrick.vrijlandt, last changed 2012-08-18 10:25 by petri.lehtinen.

Files
File name Uploaded Description Edit
issue15588.patch petri.lehtinen, 2012-08-18 10:25 review
Messages (2)
msg167672 - (view) Author: patrick vrijlandt (patrick.vrijlandt) Date: 2012-08-08 07:30
quopri.py's functions encodestring and decodestring are documented to handle strings; and this is clearly suggested by their name. However, these functions accept and return bytes, not strings. This should be reflected in the documentation. 

Even better: deprecate these functions and introduce new ones with behaviour as suggested by their names: encode_string, encode_bytes etc.
msg168502 - (view) Author: Petri Lehtinen (petri.lehtinen) * (Python committer) Date: 2012-08-18 10:25
The encode() and decode() functions also expect binary file objects.

Attached a patch that changes documentation and docstrings. Removed the mentions of readline(), because read() is called on input instead, if the binascii module is available. Also removed the repeated descriptions of quotetabs and header in encodestring()'s docs.
History
Date User Action Args
2012-08-18 10:25:45petri.lehtinensetfiles: + issue15588.patch

nosy: + petri.lehtinen
messages: + msg168502

keywords: + patch, needs review
stage: patch review
2012-08-08 17:39:56r.david.murraysetnosy: + barry, r.david.murray

components: + email
versions: + Python 3.3, Python 3.4
2012-08-08 07:30:58patrick.vrijlandtcreate