[rhythmbox/wip/python3: 29/35] rb.URLCache: store cache data items as binary



commit 359913b693296c3b4f0ffc78536bd4819e2eb8d7
Author: Jonathan Matthew <jonathan d14n org>
Date:   Sat Apr 20 23:21:19 2013 +1000

    rb.URLCache: store cache data items as binary

 plugins/rb/URLCache.py | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/plugins/rb/URLCache.py b/plugins/rb/URLCache.py
index 979252e..0492898 100644
--- a/plugins/rb/URLCache.py
+++ b/plugins/rb/URLCache.py
@@ -152,7 +152,7 @@ class URLCache(object):
             path = self.cachefile(key)
 
             # consider using gio set contents async?
-            f = open(path, 'w')
+            f = open(path, 'wb')
             f.write(data)
             f.close()
 
@@ -165,7 +165,7 @@ class URLCache(object):
         if data is None:
             cachefile = self.check(key, False)
             if cachefile is not None:
-                f = open(cachefile)
+                f = open(cachefile, 'rb')
                 data = f.read()
                 f.close()
                 if callback(data, *args) is False:
@@ -194,7 +194,7 @@ class URLCache(object):
         cachefile = self.check(key, True)
         if cachefile is not None:
             # could use a loader here, maybe
-            f = open(cachefile)
+            f = open(cachefile, 'rb')
             data = f.read()
             f.close()
             if callback(data, *args) is not False:


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]