ULG PATCH: gracefully handle non UTF-8 output of whois
Frederik Kriewitz
frederik at kriewitz.eu
Wed Jun 4 16:22:13 CEST 2014
missing attachment
On Wed, Jun 4, 2014 at 4:21 PM, Frederik Kriewitz <frederik at kriewitz.eu> wrote:
> Fixes exeptions like this (in case whois returns non utf-8 output):
> ERROR in CGI: Traceback (most recent call last):
> File "/var/www/html/ulg.py", line 775, in <module>
> handler.whois(**params)
> File "/var/www/html/ulg.py", line 738, in whois
> print self.runULGWhois(key,objtype)
> File "/var/www/html/ulg.py", line 710, in runULGWhois
> res = whois.lookup(key)
> File "/var/www/html/whois.py", line 43, in lookup
> res=res+l.decode('utf-8')
> File "/usr/lib/python2.7/encodings/utf_8.py", line 16, in decode
> return codecs.utf_8_decode(input, errors, True)
> UnicodeDecodeError: 'utf8' codec can't decode byte 0xf3 in position 24:
> invalid continuation byte
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0002-gracefully-handle-non-UTF-8-output-of-whois.patch
Type: application/octet-stream
Size: 1638 bytes
Desc: not available
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20140604/bb34cf5f/attachment-0001.obj>
More information about the Bird-users
mailing list