]> git.ipfire.org Git - thirdparty/dnspython.git/commitdiff
Document dns.message.from_text() blank line behavior [Issue #354].
authorBob Halley <halley@dnspython.org>
Thu, 7 May 2020 13:01:30 +0000 (06:01 -0700)
committerBob Halley <halley@dnspython.org>
Thu, 7 May 2020 13:01:30 +0000 (06:01 -0700)
dns/message.py

index da1338d2f3665d896ecb37a670667900ffb3b95f..72c16befb392d6319e798556377ce6998fe69aa1 100644 (file)
@@ -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.