Author wiggin15
Recipients wiggin15
Date 2010-09-30.12:03:05
SpamBayes Score 9.4411e-09
Marked as misclassified No
Message-id <>
binascii is currently bytes-only, although the "a" in a2b\b2a should refer to unicode strings.
This patch fixes all a2b functions to take str type and all b2a functions to return str types.
This was discussed several times, for example:
As discussed, the required behavior in Python 3k is that a2b should convert str to bytes and vice versa, and this was implemented in this patch.

This patch breaks backward compatibility in several functions... It also required fixing several files under Lib (although most cases were simplified), and also to change the interface of the base64 and quopri modules (this was also requested, e.g.
Note that there already was a small change in this behavior from 3.1 to 3.2 ( - b2a_hex and b2a_qp COULD receive strings as input in 3.1 and this was changed in 3.2, so technically, compatibility was already broken...

The patch includes updates to the standard library, the tests and documentation.
rlecode and rledecode were left untouched because they are not a2b\b2a functions per se - they work on the input and output of the hqx functions (maybe it's a good idea to add new a2b\b2a functions for rle_hqx).

Any thoughts are welcome.
Date User Action Args
2010-09-30 12:03:28wiggin15setrecipients: + wiggin15
2010-09-30 12:03:23wiggin15setmessageid: <>
2010-09-30 12:03:18wiggin15linkissue9996 messages
2010-09-30 12:03:18wiggin15create