]> granicus.if.org Git - python/commitdiff
AddrlistClass.getdomainliteral(): rfc822 requires that the domain
authorBarry Warsaw <barry@python.org>
Mon, 25 Sep 2000 15:08:27 +0000 (15:08 +0000)
committerBarry Warsaw <barry@python.org>
Mon, 25 Sep 2000 15:08:27 +0000 (15:08 +0000)
literal be wrapped in square brackets.  This fix replaces the square
brackets that were previously being stripped off.  Closes SF bug
#110621.

Lib/rfc822.py

index 42aac1c403f3a7de98a63861bc19e6ee95958177..200452455851a9d6b9a22361f17a27d1acc16cbe 100644 (file)
@@ -703,7 +703,7 @@ class AddrlistClass:
     
     def getdomainliteral(self):
         """Parse an RFC-822 domain-literal."""
-        return self.getdelimited('[', ']\r', 0)
+        return '[%s]' % self.getdelimited('[', ']\r', 0)
     
     def getatom(self):
         """Parse an RFC-822 atom."""