Author: damoxc

Revision: 5203

Log:
        fix adding torrents on windows

Diff:
Modified: trunk/deluge/ui/gtkui/addtorrentdialog.py
===================================================================
--- trunk/deluge/ui/gtkui/addtorrentdialog.py   2009-04-27 22:14:49 UTC (rev 
5202)
+++ trunk/deluge/ui/gtkui/addtorrentdialog.py   2009-04-27 22:19:18 UTC (rev 
5203)
@@ -683,7 +683,7 @@
             for i, f in enumerate(torrent_filenames):
                 client.core.add_torrent_file(
                     os.path.split(f)[-1],
-                    base64.encodestring(open(f).read()),
+                    base64.encodestring(open(f, "rb").read()),
                     torrent_options[i])
         if torrent_magnets:
             client.core.add_torrent_magnets(torrent_magnets, 
torrent_magnet_options)

Modified: trunk/deluge/ui/web/json_api.py
===================================================================
--- trunk/deluge/ui/web/json_api.py     2009-04-27 22:14:49 UTC (rev 5202)
+++ trunk/deluge/ui/web/json_api.py     2009-04-27 22:19:18 UTC (rev 5203)
@@ -420,7 +420,7 @@
         """
         for torrent in torrents:
             filename = os.path.basename(torrent["path"])
-            fdump = base64.encodestring(open(torrent["path"], "r").read())
+            fdump = base64.encodestring(open(torrent["path"], "rb").read())
             log.info("Adding torrent from file `%s` with options `%r`",
                 filename, torrent["options"])
             client.core.add_torrent_file(filename, fdump, torrent["options"])



--~--~---------~--~----~------------~-------~--~----~
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