AddrlistClass.getdomainliteral(): rfc822 requires that the domain
literal be wrapped in square brackets. This fix replaces the square
brackets that were previously being stripped off. Closes SF bug
#110621.
diff --git a/Lib/rfc822.py b/Lib/rfc822.py
index 42aac1c..2004524 100644
--- a/Lib/rfc822.py
+++ b/Lib/rfc822.py
@@ -703,7 +703,7 @@
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."""