#3549: deluge-console add not adding torrent filenames with embedded spaces
--------------------------+---------------------------------
  Reporter:  marcelpaulo  |      Owner:
      Type:  bug          |     Status:  new
  Priority:  minor        |  Milestone:  needs verified
 Component:  Unknown      |    Version:  2.1.0
Resolution:               |   Keywords:  console add torrent
--------------------------+---------------------------------

Comment (by marcelpaulo):

 Didn't have my email address configured, so didn't see your reply earlier.

 Playing with quoting, I stumbled across a workaround that works for any
 torrent file, with or without embedded spaces:

 {{{
 deluge-console "add 'torrent-file'"
 }}}

 but it breaks for magnet links:

 {{{
 Traceback (most recent call last):
   File "/usr/bin/deluge-console", line 33, in <module>
     sys.exit(load_entry_point('deluge==2.1.1', 'console_scripts', 'deluge-
 console')())
   File "/usr/lib/python3/dist-packages/deluge/ui/console/__init__.py",
 line 16, in start
     return Console().start()
   File "/usr/lib/python3/dist-packages/deluge/ui/console/console.py", line
 148, in start
     super().start(self.console_parser)
   File "/usr/lib/python3/dist-packages/deluge/ui/ui.py", line 64, in start
     self.__options = self.parse_args(parser, args)
   File "/usr/lib/python3/dist-packages/deluge/ui/ui.py", line 43, in
 parse_args
     options = parser.parse_args(args)
   File "/usr/lib/python3/dist-packages/deluge/ui/console/parser.py", line
 73, in parse_args
     multi_command = self._split_args(args)
   File "/usr/lib/python3/dist-packages/deluge/ui/console/parser.py", line
 50, in _split_args
     cmds = shlex.split(cmd_line)
   File "/usr/lib/python3.10/shlex.py", line 315, in split
     return list(lex)
   File "/usr/lib/python3.10/shlex.py", line 300, in __next__
     token = self.get_token()
   File "/usr/lib/python3.10/shlex.py", line 109, in get_token
     raw = self.read_token()
   File "/usr/lib/python3.10/shlex.py", line 191, in read_token
     raise ValueError("No closing quotation")
 ValueError: No closing quotation
 }}}

 So, for magnet links, this works:

 {{{
 deluge-console add "magnet-link"
 }}}

--
Ticket URL: <https://dev.deluge-torrent.org/ticket/3549#comment:2>
Deluge <https://deluge-torrent.org/>
Deluge Project

-- 
You received this message because you are subscribed to the Google Groups 
"Deluge Dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/deluge-dev/065.6b52527c36f58d30869076bd0367b0c3%40deluge-torrent.org.

Reply via email to