[Pythonmac-SIG] rfc822 lib
Francois Granger
fgranger@altern.org
Sat, 12 Aug 2000 13:15:10 +0200
At 12:28 +0200 on 24/07/00, in message Re: [Pythonmac-SIG] rfc822
lib, you wrote:
>on 23/07/00 23:01, Rod Morehead at rmore@rmore.net wrote:
>
> > I would guess that this is because if you open a file in text mode on
> > the Mac CR and LF are swapped and CR-LF become LF-CR which confuses
> > the code (if you open it in binary mode they aren't, but then '\n'
> > isn't a mac newline '\r' is).
>
>I did not thought of this. If the rfc library can work with this, it will
>not be a big issue since I never access the file directly. Only the content
>of the message may be with wrong lines ending ?
>
> >
> > If performance isn't too important an easy workaround would be to try
> > opening the file in binary mode ('rb') and then if that fails fall
> > back to text mode. If that still fails then I would suspect something
> > else is the problem.
I did try your advice of opening in binary. It works.
Thanks.
François Granger
--
"Computers are like horses; they can sense fear and will act based on
that. Or, look at it like this. If you have a premonition of danger,
maybe you're right." - Adam Engst