This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author martin.panter
Recipients docs@python, fredstober, lemburg, martin.panter, r.david.murray, serhiy.storchaka, vajrasky
Date 2015-01-18.06:32:32
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1421562753.9.0.1137991851.issue20121@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch that clarifies in the documentation and test suite how newlines work in the “quopri” and “binascii” modules. It also fixes the native Python implementation to support CRLFs.

* \n is used by default (e.g. for soft line breaks if the input has no hard line breaks)
* CRLF is used instead if found in input (even in non-text mode!)
* Typo errors in documentation
* quopri uses istext=True
* header flag does not affect newline encoding; only istext affects it

One corner case concerns me slightly: binascii.b2a_qp(istext=False) will use \n for soft line breaks by default, but will suddenly switch to CRLF if the input data happens to contain a CRLF sequence. This is despite the CRLFs from the data being encoded and therefore not appearing in the output themselves.
History
Date User Action Args
2015-01-18 06:32:34martin.pantersetrecipients: + martin.panter, lemburg, r.david.murray, docs@python, serhiy.storchaka, vajrasky, fredstober
2015-01-18 06:32:33martin.pantersetmessageid: <1421562753.9.0.1137991851.issue20121@psf.upfronthosting.co.za>
2015-01-18 06:32:33martin.panterlinkissue20121 messages
2015-01-18 06:32:33martin.pantercreate