changeset 487:782c389db4e9

avoid crashing on non-ASCII hostnames imported from: moin--main--1.5--patch-491
author Thomas Waldmann <tw@waldmann-edv.de>
date Tue, 21 Mar 2006 08:59:51 +0000
parents 72e96d74f98d
children fa890b814205
files ChangeLog MoinMoin/logfile/editlog.py docs/CHANGES
diffstat 3 files changed, 18 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Tue Mar 21 08:36:53 2006 +0000
+++ b/ChangeLog	Tue Mar 21 08:59:51 2006 +0000
@@ -2,6 +2,20 @@
 # arch-tag: automatic-ChangeLog--arch@arch.thinkmo.de--2003-archives/moin--main--1.5
 #
 
+2006-03-21 09:59:51 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-491
+
+    Summary:
+      avoid crashing on non-ASCII hostnames
+    Revision:
+      moin--main--1.5--patch-491
+
+    avoid crashing on non-ASCII hostnames
+    
+
+    modified files:
+     ChangeLog MoinMoin/logfile/editlog.py docs/CHANGES
+
+
 2006-03-21 09:36:53 GMT	Thomas Waldmann <tw@waldmann-edv.de>	patch-490
 
     Summary:
--- a/MoinMoin/logfile/editlog.py	Tue Mar 21 08:36:53 2006 +0000
+++ b/MoinMoin/logfile/editlog.py	Tue Mar 21 08:59:51 2006 +0000
@@ -150,7 +150,8 @@
                 
             try:
                 hostname = socket.gethostbyaddr(host)[0]
-            except socket.error:
+                hostname = unicode(hostname, config.charset)
+            except (socket.error, UnicodeError), err:
                 hostname = host
 
             remap_chars = {u'\t': u' ', u'\r': u' ', u'\n': u' ',}
--- a/docs/CHANGES	Tue Mar 21 08:36:53 2006 +0000
+++ b/docs/CHANGES	Tue Mar 21 08:59:51 2006 +0000
@@ -103,6 +103,8 @@
     * Speedup group/dicts scanning for persistent servers.
     * Implemented HEAD requests for standalone server, this should fix some of
       the strange effects happening when using "Save as" on attachments.
+    * Not a moin bug, but rather a workaround for non-standard non-ASCII DNS
+      hostnames: we just use the IP instead of crashing now.
 
   Other:
     * Added css classes for the rst admonitions. Thanks to TiagoMacambira!