A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2001-November/018654.html below:

[Python-Dev] CRLF in email.Generator

[Python-Dev] CRLF in email.GeneratorGreg Ward gward@python.net
Fri, 16 Nov 2001 14:24:58 -0500
On 16 November 2001, Gustavo Niemeyer said [regarding the 'email' package]
> I've been looking at the Generator module. It seems to be writing
> the message with:
> 
> print >> self._fp, "text"
> 
> This should probably be replaced by:
> 
> self._fp.write("text"+"\r\n")

This is true if, say, _fp is a socket connected to an SMTP server.

But conventional usage (eg. my ~/Mailbox) dictates that lines end with
"\n" in a Unix filesystem.

Perhaps the Right Answer is:

  self._fp.write("text" + nl)

where the value of nl ("\n", "\r\n", "\r", whatever) depends on the
platform and the target of the message (file, SMTP server, whatever).

        Greg
-- 
Greg Ward - programmer-at-large                         gward@python.net
http://starship.python.net/~gward/
And now for something completely different.



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4