mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-06 08:28:39 +00:00
Fix #475 catch unicode decoding errors
This commit is contained in:
parent
4933445d86
commit
7813bd4098
1 changed files with 7 additions and 2 deletions
|
@ -331,9 +331,14 @@ class TorrentManager(component.Component):
|
||||||
else:
|
else:
|
||||||
storage_mode = lt.storage_mode_t(1)
|
storage_mode = lt.storage_mode_t(1)
|
||||||
|
|
||||||
# Fill in the rest of the add_torrent_params dictionary
|
try:
|
||||||
add_torrent_params["save_path"] = options["download_location"].encode("utf8")
|
# Try to encode this as utf8 if needed
|
||||||
|
options["download_location"] = options["download_location"].encode("utf8")
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
pass
|
||||||
|
|
||||||
|
# Fill in the rest of the add_torrent_params dictionary
|
||||||
|
add_torrent_params["save_path"] = options["download_location"]
|
||||||
add_torrent_params["storage_mode"] = storage_mode
|
add_torrent_params["storage_mode"] = storage_mode
|
||||||
add_torrent_params["paused"] = True
|
add_torrent_params["paused"] = True
|
||||||
add_torrent_params["auto_managed"] = False
|
add_torrent_params["auto_managed"] = False
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue