[Python-checkins] cpython (merge 3.2 -> default): Merge: I was right, hardconding the localhost IP doesn't work in linux-vserver.

r.david.murray python-checkins at python.org
Mon May 2 14:48:48 CEST 2011


http://hg.python.org/cpython/rev/07613ea46dbc
changeset:   69778:07613ea46dbc
parent:      69776:51fe7d3250a1
parent:      69777:89b9b7094068
user:        R David Murray <rdmurray at bitdance.com>
date:        Mon May 02 08:48:00 2011 -0400
summary:
  Merge: I was right, hardconding the localhost IP doesn't work in linux-vserver.

files:
  Lib/test/test_smtplib.py |  9 +++------
  1 files changed, 3 insertions(+), 6 deletions(-)


diff --git a/Lib/test/test_smtplib.py b/Lib/test/test_smtplib.py
--- a/Lib/test/test_smtplib.py
+++ b/Lib/test/test_smtplib.py
@@ -290,8 +290,7 @@
         self.serv_evt.wait()
         self.output.flush()
         # Add the X-Peer header that DebuggingServer adds
-        # XXX: I'm not sure hardcoding this IP will work on linux-vserver.
-        m['X-Peer'] = '127.0.0.1'
+        m['X-Peer'] = socket.gethostbyname('localhost')
         mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
         self.assertEqual(self.output.getvalue(), mexpect)
 
@@ -311,8 +310,7 @@
         self.serv_evt.wait()
         self.output.flush()
         # Add the X-Peer header that DebuggingServer adds
-        # XXX: I'm not sure hardcoding this IP will work on linux-vserver.
-        m['X-Peer'] = '127.0.0.1'
+        m['X-Peer'] = socket.gethostbyname('localhost')
         # The Bcc header is deleted before serialization.
         del m['Bcc']
         mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
@@ -341,8 +339,7 @@
         self.serv_evt.wait()
         self.output.flush()
         # Add the X-Peer header that DebuggingServer adds
-        # XXX: I'm not sure hardcoding this IP will work on linux-vserver.
-        m['X-Peer'] = '127.0.0.1'
+        m['X-Peer'] = socket.gethostbyname('localhost')
         mexpect = '%s%s\n%s' % (MSG_BEGIN, m.as_string(), MSG_END)
         self.assertEqual(self.output.getvalue(), mexpect)
         debugout = smtpd.DEBUGSTREAM.getvalue()

-- 
Repository URL: http://hg.python.org/cpython


More information about the Python-checkins mailing list