summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDamien Churchill <damoxc@gmail.com>2010-05-03 18:43:31 +0100
committerDamien Churchill <damoxc@gmail.com>2010-05-03 18:43:31 +0100
commitacba442ddb13d3d6e8bde3c257b0bebd39fc1896 (patch)
treeedee2ca0649166a6bd12e8401b00e22a006c1c4f
parent5b0f93ba7217981c3e01886128a595c3ded339b7 (diff)
downloaddeluge-acba442ddb13d3d6e8bde3c257b0bebd39fc1896.tar.gz
deluge-acba442ddb13d3d6e8bde3c257b0bebd39fc1896.tar.bz2
deluge-acba442ddb13d3d6e8bde3c257b0bebd39fc1896.zip
fix encoding issues where the users filesystem isn't utf-8 (needs testing)
-rw-r--r--deluge/ui/gtkui/createtorrentdialog.py12
1 files changed, 8 insertions, 4 deletions
diff --git a/deluge/ui/gtkui/createtorrentdialog.py b/deluge/ui/gtkui/createtorrentdialog.py
index 0cd3a534f..f9b5a8ac5 100644
--- a/deluge/ui/gtkui/createtorrentdialog.py
+++ b/deluge/ui/gtkui/createtorrentdialog.py
@@ -35,6 +35,7 @@
import gtk
+import sys
import pkg_resources
import os.path
import gobject
@@ -158,8 +159,10 @@ class CreateTorrentDialog:
chooser.destroy()
return
+ path = result.decode('utf-8').encode(sys.getfilesystemencoding())
+
self.files_treestore.clear()
- self.files_treestore.append(None, [result, gtk.STOCK_FILE, deluge.common.get_path_size(result)])
+ self.files_treestore.append(None, [result, gtk.STOCK_FILE, deluge.common.get_path_size(path)])
self.adjust_piece_size()
chooser.destroy()
@@ -184,9 +187,10 @@ class CreateTorrentDialog:
chooser.destroy()
return
- self.files_treestore.clear()
+ path = result.decode('utf-8').encode(sys.getfilesystemencoding())
- self.files_treestore.append(None, [result, gtk.STOCK_OPEN, deluge.common.get_path_size(result)])
+ self.files_treestore.clear()
+ self.files_treestore.append(None, [result, gtk.STOCK_OPEN, deluge.common.get_path_size(path)])
self.adjust_piece_size()
chooser.destroy()
@@ -328,7 +332,7 @@ class CreateTorrentDialog:
self.glade.get_widget("progress_dialog").hide_all()
deferToThread(self.create_torrent,
- path,
+ path.decode('utf-8').encode(sys.getfilesystemencoding()),
tracker,
piece_length,
self._on_create_torrent_progress,