Module: deluge
Branch: 1.3-stable
Commit: 3bd28208d17567b9fe81a715767c3545f2332587

Author: Calum Lind <[email protected]>
Date:   Fri Feb  4 23:16:42 2011 +0000

Fix for deluge-console adding torrent files in Windows

---

 deluge/ui/console/commands/add.py      |    2 +-
 deluge/ui/gtkui/createtorrentdialog.py |    2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/deluge/ui/console/commands/add.py 
b/deluge/ui/console/commands/add.py
index 8d68818..7878438 100644
--- a/deluge/ui/console/commands/add.py
+++ b/deluge/ui/console/commands/add.py
@@ -71,7 +71,7 @@ class Command(BaseCommand):
                 continue
             self.console.write("{!info!}Attempting to add torrent: %s" % arg)
             filename = os.path.split(arg)[-1]
-            filedump = base64.encodestring(open(arg).read())
+            filedump = base64.encodestring(open(arg, "rb").read())
 
             def on_success(result):
                 self.console.write("{!success!}Torrent added!")
diff --git a/deluge/ui/gtkui/createtorrentdialog.py 
b/deluge/ui/gtkui/createtorrentdialog.py
index 5624a63..c455eb0 100644
--- a/deluge/ui/gtkui/createtorrentdialog.py
+++ b/deluge/ui/gtkui/createtorrentdialog.py
@@ -367,7 +367,7 @@ class CreateTorrentDialog:
         if add_to_session:
             client.core.add_torrent_file(
                 os.path.split(target)[-1],
-                base64.encodestring(open(target).read()),
+                base64.encodestring(open(target, "rb").read()),
                 {"download_location": os.path.split(path)[0]})
 
     def _on_create_torrent_progress(self, value, num_pieces):

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