merge 3.5
authorAurelien Campeas <aurelien.campeas@logilab.fr>
Tue, 08 Sep 2009 20:08:10 +0200
branch3.5
changeset 3123 5ce118f80936
parent 3121 dbc02844d412 (current diff)
parent 3122 0e49d2679c5c (diff)
child 3125 52b6b8c2ccc5
child 3165 0a50ebe53db7
merge
--- a/web/views/__init__.py	Tue Sep 08 17:24:08 2009 +0200
+++ b/web/views/__init__.py	Tue Sep 08 20:08:10 2009 +0200
@@ -8,8 +8,8 @@
 __docformat__ = "restructuredtext en"
 
 import os
+import sys
 import tempfile
-
 from rql import nodes
 
 
@@ -110,13 +110,14 @@
         self.cell_call()
 
     def cell_call(self, row=0, col=0):
-        self.row, self.col = row, col # in case one need it
+        self.row, self.col = row, col # in case one needs it
         _, tmpfile = tempfile.mkstemp('.png')
         try:
             self._generate(tmpfile)
-            self.w(open(tmpfile).read())
+            self.w(open(tmpfile, 'rb').read())
         finally:
             try:
                 os.unlink(tmpfile)
             except Exception, ex:
-                self.warning('cant delete %s: %s', tmpfile, ex)
+                if sys.platform != 'win32':
+                      self.warning("can't delete %s : %s" % (tmpfile, ex))