From: Bob Halley Date: Thu, 7 May 2020 13:01:30 +0000 (-0700) Subject: Document dns.message.from_text() blank line behavior [Issue #354]. X-Git-Tag: v2.0.0rc1~259 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef75090c2dcbca6aa79e06acc840348575ad83be;p=thirdparty%2Fdnspython.git Document dns.message.from_text() blank line behavior [Issue #354]. --- diff --git a/dns/message.py b/dns/message.py index da1338d2..72c16bef 100644 --- a/dns/message.py +++ b/dns/message.py @@ -1013,6 +1013,10 @@ class _TextReader(object): def from_text(text, idna_codec=None): """Convert the text format message into a message object. + The reader stops after reading the first blank line in the input to + facilitate reading multiple messages from a single file with + ``dns.message.from_file()``. + *text*, a ``text``, the text format message. *idna_codec*, a ``dns.name.IDNACodec``, specifies the IDNA @@ -1041,6 +1045,8 @@ def from_text(text, idna_codec=None): def from_file(f): """Read the next text format message from the specified file. + Message blocks are separated by a single blank line. + *f*, a ``file`` or ``text``. If *f* is text, it is treated as the pathname of a file to open.