For anonymous ftp, make sure local hostname is fully qualified.
diff --git a/Lib/ftplib.py b/Lib/ftplib.py
index 7a414e6..a25d467 100644
--- a/Lib/ftplib.py
+++ b/Lib/ftplib.py
@@ -221,6 +221,10 @@
if not user: user = 'anonymous'
if user == 'anonymous' and passwd in ('', '-'):
thishost = socket.gethostname()
+ # Make sure it is fully qualified
+ if not '.' in thishost:
+ thisaddr = socket.gethostbyname(thishost)
+ thishost = socket.gethostbyaddr(thisaddr)[0]
try:
if os.environ.has_key('LOGNAME'):
realuser = os.environ['LOGNAME']