Author: johnnyg

Revision: 5608

Log:
        Make sure url, filename and headers are strings before downloading.

Diff:
Modified: trunk/deluge/httpdownloader.py
===================================================================
--- trunk/deluge/httpdownloader.py      2009-08-01 02:38:30 UTC (rev 5607)
+++ trunk/deluge/httpdownloader.py      2009-08-01 03:00:04 UTC (rev 5608)
@@ -106,6 +106,11 @@
     :raises t.w.e.Error: for all other HTTP response errors (besides OK)
     """
     url = str(url)
+    filename = str(filename)
+    if headers:
+        for key, value in headers.items():
+            headers[str(key)] = str(value)
+
     scheme, host, port, path = client._parse(url)
     factory = HTTPDownloader(url, filename, callback, headers)
     if scheme == "https":

Modified: trunk/deluge/plugins/blocklist/blocklist/core.py
===================================================================
--- trunk/deluge/plugins/blocklist/blocklist/core.py    2009-08-01 02:38:30 UTC 
(rev 5607)
+++ trunk/deluge/plugins/blocklist/blocklist/core.py    2009-08-01 03:00:04 UTC 
(rev 5608)
@@ -229,7 +229,7 @@
 
         headers = {}
         if self.config["last_update"] and not self.force_download:
-            headers['If-Modified-Since'] = str(self.config["last_update"])
+            headers['If-Modified-Since'] = self.config["last_update"]
 
         log.debug("Attempting to download blocklist %s" % url)
         log.debug("Sending headers: %s" % headers)

Modified: trunk/deluge/ui/web/json_api.py
===================================================================
--- trunk/deluge/ui/web/json_api.py     2009-08-01 02:38:30 UTC (rev 5607)
+++ trunk/deluge/ui/web/json_api.py     2009-08-01 03:00:04 UTC (rev 5608)
@@ -459,7 +459,7 @@
         log.debug("filename: %s", tmp_file)
         headers = {}
         if cookie:
-            headers["Cookie"] = str(cookie)
+            headers["Cookie"] = cookie
             log.debug("cookie: %s", cookie)
         return httpdownloader.download_file(url, tmp_file, headers=headers)
     



--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"deluge-commit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/deluge-commit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to