Error on mimetools?
aheimsbakk at hotmail.com
Wed Aug 1 00:22:04 CEST 2001
> > I'm using only the raw base64 text. It is the same text I used in
> > my winzip experiment and in python test program I've made. It works
> > in winzip but not with python code. As I mentioned python gives me
> > a file slightly bigger than winzip. It's about 300 bytes bigger.
> > I'm without clues to this one. It does not seem to be any logic in
> > the error.
> [You really should mention (among other things) the OS you're using,
> but as you posted your message with OE, I'll assume it's Windows.]
> It sounds as if you might have openened a file in the text mode instead
> of the binary mode (or possibly the other way round). In Windows,
> saving a binary file in the text mode will cause spurious '\r'
> characters to be inserted into the stream for every '\n'. Be thankful
> you don't own a Mac: on that platform every '\n' is *replaced* by an
> '\r', depriving you of a valuable clue something is wrong.
> Assuming the file consists of random characters, 1 in every 256
> characters will be a '\n', so the 300 extra bytes would indicate a file
> size of about 75000 bytes.
> If this is the cause the remedy is simple: try finding an
> open(somefilename, 'w') in the code, and change the 'w' to 'wb'.
Thanks for the help. I have not had the time to test it out yet. But it
sounds like it may be the cause of the problem. I'll try to work around the
problem then :)
More information about the Python-list