Package: urlwatch
Version: 1.7-1
Severity: normal
Tags: patch

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi,

on certain errors urlwatch crashes with a backtrace:
$ urlwatch
Traceback (most recent call last):
  File "/usr/bin/urlwatch", line 231, in <module>
    data = filter(url, urllib2.urlopen(request).read())
  File "/usr/lib/python2.5/urllib2.py", line 124, in urlopen
    return _opener.open(url, data)
  File "/usr/lib/python2.5/urllib2.py", line 381, in open
    response = self._open(req, data)
  File "/usr/lib/python2.5/urllib2.py", line 399, in _open
    '_open', req)
  File "/usr/lib/python2.5/urllib2.py", line 360, in _call_chain
    result = func(*args)
  File "/usr/lib/python2.5/urllib2.py", line 1107, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/usr/lib/python2.5/urllib2.py", line 1080, in do_open
    r = h.getresponse()
  File "/usr/lib/python2.5/httplib.py", line 928, in getresponse
    response.begin()
  File "/usr/lib/python2.5/httplib.py", line 385, in begin
    version, status, reason = self._read_status()
  File "/usr/lib/python2.5/httplib.py", line 349, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine

The attached patch catches all http errors when retrieving URL
content.

Regards,
  Bastian


- -- System Information:
Debian Release: squeeze/sid
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.29grog6 (SMP w/2 CPU cores)
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages urlwatch depends on:
ii  python                        2.5.4-2    An interactive high-level object-o
ii  python-support                1.0.3      automated rebuilding support for P

Versions of packages urlwatch recommends:
pn  lynx                          <none>     (no description available)
ii  python-utidylib               0.2-3.2    Python wrapper for TidyLib
pn  python-vobject                <none>     (no description available)

Versions of packages urlwatch suggests:
ii  html2text                     1.3.2a-14  advanced HTML to text converter

- -- no debconf information

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iEYEARECAAYFAkoVGmoACgkQeBwlBDLsbz6VsgCfdKIf67n3KAu/RaJKzWQWe5q+
2KcAni0EKZAHxOVIZD3x/erNtB1FTXBW
=fVDt
-----END PGP SIGNATURE-----
--- /usr/bin/urlwatch   2009-01-08 00:02:45.000000000 +0100
+++ /tmp/urlwatch       2009-05-21 11:07:29.000000000 +0200
@@ -243,7 +243,7 @@
                 details += foutput('new', url, None, summary)
             log.info('writing current content of %s to %s' % (url, filename))
             open(filename, 'w').write(data)
-        except urllib2.HTTPError, error:
+        except (urllib2.HTTPError, httplib.error), error:
             log.error('got HTTPError while loading url: %s' % error)
             if display_errors:
                 details += foutput('error', url, error, summary)

Reply via email to