From ef75090c2dcbca6aa79e06acc840348575ad83be Mon Sep 17 00:00:00 2001 From: Bob Halley Date: Thu, 7 May 2020 06:01:30 -0700 Subject: [PATCH] Document dns.message.from_text() blank line behavior [Issue #354]. --- dns/message.py | 6 ++++++ 1 file changed, 6 insertions(+) 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. -- 2.47.3