[issue4387] binascii b2a functions accept strings (unicode) as data

2008-12-01 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Committed as r67472. -- status: open -> closed ___ Python tracker <[EMAIL PROTECTED]> ___ ___

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-30 Thread Barry A. Warsaw
Barry A. Warsaw <[EMAIL PROTECTED]> added the comment: Martin, the patch looks okay to me. I vote for applying it. -- nosy: +barry resolution: -> accepted ___ Python tracker <[EMAIL PROTECTED]>

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-30 Thread Martin v. Löwis
Changes by Martin v. Löwis <[EMAIL PROTECTED]>: -- keywords: +needs review ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Python-bugs-li

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-30 Thread Martin v. Löwis
Martin v. Löwis <[EMAIL PROTECTED]> added the comment: Here is a patches that fixes the problem. Notice that this affects the email API; base64mime.body_encode now also requires bytes (whereas quoprimime remains unchanged). There are probably more functions that still incorrectly accept strings

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-29 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: Hmm, I obviously meant: [...] In other words, it might/should be ok for `binascii.a2b_base64('YWFh\n')` to return the same as `binascii.a2b_base64(b'YWFh\n')` (that is, b'aaa') [...] ___ Python tracker <[E

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-29 Thread Antoine Pitrou
Antoine Pitrou <[EMAIL PROTECTED]> added the comment: It's not /exactly/ nonsense, it seems to assume an utf8 encoding pass is necessary: >>> b'\xe1\x80\x80'.decode('utf8') == '\u1000' True IMO, while accepting unicode strings instead of bytes for the a2b_xx functions is understandable (because

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-22 Thread Georg Brandl
Georg Brandl <[EMAIL PROTECTED]> added the comment: I vote yes. -- nosy: +georg.brandl ___ Python tracker <[EMAIL PROTECTED]> ___ ___ Py

[issue4387] binascii b2a functions accept strings (unicode) as data

2008-11-21 Thread Terry J. Reedy
New submission from Terry J. Reedy <[EMAIL PROTECTED]>: Binascii b2a_xxx functions accept 'binary data' and return ascii-encoded bytes. The corresponding a2b_xxx functions turn the ascii-encoded bytes back to 'binary data' (bytes). If the binary data is bytes, these should be inverses of each o