Re: Why the inconsistent of those two base64 methods?

2010-05-12 Thread Mensanator
On May 12, 4:20 am, Maarten wrote: > On May 12, 6:04 am, Leo Jay wrote: > > > I'd like to encode a string in base64, but I found a inconsistent of > > two methods: > > > >>> 'aaa'.encode('base64') > > 'YWFh\n' > > >>> import base64 > > >>> base64.b64encode('aaa') > > 'YWFh' > > > as you can see,

Re: Why the inconsistent of those two base64 methods?

2010-05-12 Thread Maarten
On May 12, 6:04 am, Leo Jay wrote: > I'd like to encode a string in base64, but I found a inconsistent of > two methods: > > >>> 'aaa'.encode('base64') > 'YWFh\n' > >>> import base64 > >>> base64.b64encode('aaa') > 'YWFh' > > as you can see, the result of > 'aaa'.encode('base64') > has a '\n' at t

Why the inconsistent of those two base64 methods?

2010-05-11 Thread Leo Jay
I'd like to encode a string in base64, but I found a inconsistent of two methods: >>> 'aaa'.encode('base64') 'YWFh\n' >>> import base64 >>> base64.b64encode('aaa') 'YWFh' >>> as you can see, the result of 'aaa'.encode('base64') has a '\n' at the end, but the other method doesn't. Why the incons