classification
Title: Windows base64 Decode
Type: Stage:
Components: Library (Lib) Versions: Python 2.5
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: ahirreddy, eric.smith
Priority: Keywords:

Created on 2008-08-19 02:24 by ahirreddy, last changed 2008-08-22 17:30 by eric.smith.

Messages
msg71400 (view) Author: Ahir Reddy (ahirreddy) Date: 2008-08-19 02:24
I'm new to this and not quite sure how to go about posting an issue, but
I will do the best I can. In Python 2.5.2, both from python.org and
active state, all methods of decoding in base64 under Windows produce
different output than base64 decoding under UNIX (I've tested it both on
OS X and Linux, which produce the same results). I ran into this while
writing a script that downloads email and parses mime attachments which
are base64 encoded by a similar upload script. UNIX systems are able to
download the attachments and decode the base64 back to the original
attachments correctly, which I've verified with md5sum hashes. The same
script under windows produces an incorrect file. At first I was not sure
what the issue was, and I eventually wrote the raw base64 attachment to
a file. I then used a windows command line tool to decode the file and
it produced the correct output (again checked by md5sum). This leads me
to believe that something is strange with base64 under Windows. I hope
my explanation has helped some. If need be I'll upload the script so
others can replicate my results.

Ahir
msg71759 (view) Author: Eric Smith (eric.smith) Date: 2008-08-22 17:30
Please upload your script, or (preferably) some small test code.

I suspect the problem is related to line endings and binary versus text
files.
History
Date User Action Args
2008-08-22 17:30:47eric.smithsetnosy: + eric.smith
messages: + msg71759
2008-08-19 02:24:44ahirreddycreate