[datafeed] Set headers parameter to an empty dict in DataFeedParser.retrieve_url
authorDenis Laxalde <denis.laxalde@logilab.fr>
Wed, 07 Jan 2015 16:22:27 +0100
changeset 10143 2eb06486273a
parent 10142 f4a4556f23da
child 10144 5bdaef93665f
[datafeed] Set headers parameter to an empty dict in DataFeedParser.retrieve_url This parameter is then passed to urllib2.Request, which expects a dict and won't check for None. Closes #4842333.
server/sources/datafeed.py
--- a/server/sources/datafeed.py	Thu Jan 22 10:43:24 2015 +0100
+++ b/server/sources/datafeed.py	Wed Jan 07 16:22:27 2015 +0100
@@ -319,6 +319,8 @@
         * handle file:// URL
         * other will be considered as plain content, useful for testing purpose
         """
+        if headers is None:
+            headers = {}
         if url.startswith('http'):
             url = self.normalize_url(url)
             if data: