#2174: Unable to add torrent via URL
-----------------------+----------------------------------------------------
Reporter: underscor | Owner:
Type: bug | Status: new
Priority: critical | Milestone: Future
Component: console | Version: git master
Keywords: |
-----------------------+----------------------------------------------------
Comment(by damoxc):
Hi,
Would you mind testing out the following patch and seeing if it works for
you?
{{{
#!diff
diff --git a/deluge/ui/console/main.py b/deluge/ui/console/main.py
index 55a5c68..052e556 100644
--- a/deluge/ui/console/main.py
+++ b/deluge/ui/console/main.py
@@ -41,6 +41,11 @@
import re
import locale
+try:
+ import shlex
+except ImportError:
+ shlex = None
+
from twisted.internet import defer, reactor
import deluge.component as component
@@ -266,7 +271,10 @@ def epilog(self):
def split(self, text):
if deluge.common.windows_check():
text = text.replace('\\', '\\\\')
- result = re.split(r"(?<!\\) ", text)
+ if shlex:
+ result = shlex.split(text)
+ else:
+ result = re.split(r"(?<!\\) ", text)
for i, s in enumerate(result):
result[i] = s.replace(r'\ ', ' ')
result = filter(lambda s: s != '', result)
@@ -475,4 +483,4 @@ def write_event(self, s):
component.get("LegacyUI").add_line(s, False)
self.events.append(s)
else:
- print colors.strip_colors(s.encode(self.encoding))
\ No newline at end of file
+ print colors.strip_colors(s.encode(self.encoding))
}}}
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/2174#comment:6>
Deluge <http://deluge-torrent.org/>
Deluge project
--
You received this message because you are subscribed to the Google Groups
"Deluge Dev" 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-dev?hl=en.