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

[or-cvs] r17336: {updater} Make downloaded files in binary mode. (updater/trunk/lib/thandy)



Author: nickm
Date: 2008-11-20 09:25:29 -0500 (Thu, 20 Nov 2008)
New Revision: 17336

Modified:
   updater/trunk/lib/thandy/download.py
Log:
Make downloaded files in binary mode.

Modified: updater/trunk/lib/thandy/download.py
===================================================================
--- updater/trunk/lib/thandy/download.py	2008-11-20 14:17:09 UTC (rev 17335)
+++ updater/trunk/lib/thandy/download.py	2008-11-20 14:25:29 UTC (rev 17336)
@@ -245,12 +245,12 @@
             if gotRange:
                 if gotRange.startswith("bytes %s-"%have_length):
                     logging.info("Resuming download from %s"%url)
-                    f_out = open(self._tmpPath, 'a')
+                    f_out = open(self._tmpPath, 'ab')
                 else:
                     raise thandy.DownloadError("Got an unexpected range %s"
                                                %gotRange)
             else:
-                f_out = open(self._tmpPath, 'w')
+                f_out = open(self._tmpPath, 'wb')
 
             total = 0
             while True: