Package: python-feedparser Version: 4.1-7 Severity: normal Tags: patch python-feedparser documentation says "etag will only be present if the feed was retrieved from a web server, and only if the web server provided an ETag HTTP header for the feed."
However, .etag is present always if feed was fetched from network, and contains None value, due to missing check in code. Attached is the patch which fixes the behavior. This bug is also reported upstream at http://sourceforge.net/tracker/index.php?func=detail&aid=1662900&group_id=112328&atid=661937 -- System Information: Debian Release: 4.0 APT prefers testing APT policy: (800, 'testing'), (700, 'unstable'), (1, 'experimental') Architecture: i386 (i686) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.18-3-686 Locale: LANG=C, LC_CTYPE=ru_RU.UTF-8 (charmap=UTF-8) Versions of packages python-feedparser depends on: ii python 2.4.4-2 An interactive high-level object-o ii python-support 0.5.6 automated rebuilding support for p Versions of packages python-feedparser recommends: pn python-chardet <none> (no description available) pn python-iconvcodec <none> (no description available) ii python-libxml2 2.6.27.dfsg-1 Python bindings for the GNOME XML -- no debconf information
--- feedparser.py.orig 2007-02-18 22:12:17.000000000 +0600 +++ feedparser.py 2007-02-18 22:15:50.000000000 +0600 @@ -3320,7 +3320,8 @@ # save HTTP headers if hasattr(f, 'info'): info = f.info() - result['etag'] = info.getheader('ETag') + if info.has_key('Etag'): + result['etag'] = info.getheader('ETag') last_modified = info.getheader('Last-Modified') if last_modified: result['modified'] = _parse_date(last_modified)