base64 interoperability (solved)

Christopher J. Bottaro cjbottaro at alumni.cs.utexas.edu
Fri Apr 8 17:37:43 EDT 2005


Christopher J. Bottaro wrote:

> <posted & mailed>
> 
> Fredrik Lundh wrote:
> 
>> Christopher J. Bottaro wrote:
>>> Python's base64 module encodes and decodes differently than PHP's.
>> 
>> really?
> 
> Yeah, weird, huh?  Actually the problem is that Python puts newlines at
> every 76th char.  How do I stop Python from doing that?  I just want
> everyone on one line.
> 
>>> Python's docs says that it ahere's to RFC1521 (sept 1993), while PHP's
>>> adheres
>>> to RFC2045 (nov 1996).  Is there any Python module that uses the new
>>> standard? Why is Python using the old standard anyways?
>> 
>> have you checked this, or are you just assuming that RFC1521 and RFC2045
>> contains different BASE64 definitions?
> 
> I was just assuming...=)
> 
>> (if you look at the standards,
>> you'll find
>> that they're about MIME, not BASE64 itself.  as far as I know, BASE64
>> hasn't changed a bit since it was first defined back in RFC1113).
>> 
>> </F>
> 
> -- C

Apparently the base64 module shoves newlines in there so the base64 encoded
message looks cool in email messages.  The binascii module will convert
stuff to base64 without putting those newlines in there.  Bah, why are
there two separate modules?  Confused me...=P




More information about the Python-list mailing list