Package: plucker
Version: 1.8-27

Plucker fails to download images from geocaching.com (Bad request
header) because a recent (?) change in Python's urllib changed the
header name from User-agent to User-Agent.

http://dormouse.org.uk/geocache/ has a pretty good summary:

| Problems with Python's urllib
| 
| My inital experiments on Fedora Core 6 worked fine. When I moved to Fedora 7,
| I found I was getting HTTP Bad Request errors. A little investigation with
| tcpdump revealed that two almost identical headers were being sent:
| 
| User-Agent: Python-urllib/1.17
| User-agent: Plucker/Py-1.8
| 
| On Fedora core 6, only the User-agent: Plucker/Py-1.8 was being sent. The
| problem was traced to a subtle change in Python's urllib. In Python version
| 2.4.4 (Used on Fedora Core 6), the default header has a lowercase 'a'. The
| header being User-agent: Python-urllib/1.17. This header is deleted by Plucker
| and replaced with User-agent: Plucker/Py-1.8. Unfortunately, as the header has
| been renamed in Python 2.5 (Used on Fedora 7) with a capital 'A', the deletion
| does not work. The fix was to patch Plucker as follows:
| 
| --- PyPlucker/Retriever.py.orig 2004-05-19 16:18:19.000000000 +0100
| +++ PyPlucker/Retriever.py      2007-09-03 17:53:48.000000000 +0100
| @@ -75,9 +75,9 @@
|      def __init__(self, alias_list=None, config=None, *args):
|          apply(urllib.FancyURLopener.__init__, (self,) + args)
|          self._alias_list = alias_list
| -        self.remove_header ('User-agent')
| +        self.remove_header ('User-Agent')
|          user_agent = (config and config.get_string('user_agent', None)) or 
'Plucker/Py-%s' % __version__
| -        self.addheader ('User-agent', user_agent)
| +        self.addheader ('User-Agent', user_agent)
|          referrer = config and config.get_string('referrer', None)
|          if referrer:
|              self.addheader('Referer', referrer)

This patch fixed the issue for me, please consider applying it to the
Debian package. (This might even be worth a fix in lenny.)

Christoph
-- 
[EMAIL PROTECTED] | http://www.df7cb.de/

Attachment: signature.asc
Description: Digital signature

Reply via email to