#3647: deluge console errors on addition of torrent with `;` in name
----------------------------+---------------------
 Reporter:  iconoclasthero  |       Type:  bug
   Status:  new             |   Priority:  minor
Milestone:  needs verified  |  Component:  Unknown
  Version:  2.0.5           |   Keywords:
----------------------------+---------------------
 {{{
 $ deluge-console --version
 deluge-console 2.1.1
 libtorrent: 2.0.11.0
 Python: 3.12.9
 OS: Linux 6.13.2-061302-generic
 }}}

 Background: script to create torrents and add them to deluged via deluge-
 console.

 Create a torrent with transmission-cli:
 {{{
 Creating torrent "/library/torrent/Last1, First1; Last2, First2 -- Title,
 3_e (1989, 2016).torrent"
 2 files, 84.84 MB
 1,295 pieces, 65.54 kB each
  done!
 torrentfile=/library/torrent/Last1, First1; Last2, First2 -- Title, 3_e
 (1989, 2016).torrent
 }}}

 The next step is to add the torrent to deluge via deluge-console:
 {{{
 deluge-console "connect $delugehost:$delugeport $delugeuser $delugepass;
 add -p ${linked@Q} ${torrentfile@Q}"
 }}}

 {{{
 Traceback (most recent call last):
   File "/home/user/.local/bin/deluge-console", line 8, in <module>
     sys.exit(start())
              ^^^^^^^
   File "/home/user/.local/share/pipx/venvs/deluge/lib/python3.12/site-
 packages/deluge/ui/console/__init__.py", line 16, in start
     return Console().start()
            ^^^^^^^^^^^^^^^^^
   File "/home/user/.local/share/pipx/venvs/deluge/lib/python3.12/site-
 packages/deluge/ui/console/console.py", line 148, in start
     super().start(self.console_parser)
   File "/home/user/.local/share/pipx/venvs/deluge/lib/python3.12/site-
 packages/deluge/ui/ui.py", line 64, in start
     self.__options = self.parse_args(parser, args)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/user/.local/share/pipx/venvs/deluge/lib/python3.12/site-
 packages/deluge/ui/ui.py", line 43, in parse_args
     options = parser.parse_args(args)
               ^^^^^^^^^^^^^^^^^^^^^^^
   File "/home/user/.local/share/pipx/venvs/deluge/lib/python3.12/site-
 packages/deluge/ui/console/parser.py", line 73, in parse_args
     multi_command = self._split_args(args)
                     ^^^^^^^^^^^^^^^^^^^^^^
   File "/home/user/.local/share/pipx/venvs/deluge/lib/python3.12/site-
 packages/deluge/ui/console/parser.py", line 50, in _split_args
     cmds = shlex.split(cmd_line)
            ^^^^^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.12/shlex.py", line 313, in split
     return list(lex)
            ^^^^^^^^^
   File "/usr/lib/python3.12/shlex.py", line 300, in __next__
     token = self.get_token()
             ^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.12/shlex.py", line 109, in get_token
     raw = self.read_token()
           ^^^^^^^^^^^^^^^^^
   File "/usr/lib/python3.12/shlex.py", line 191, in read_token
     raise ValueError("No closing quotation")
 ValueError: No closing quotation
 }}}

 changing torrentfile to specifically escape the semicolon does not help:
 {{{
 torrentfile=/library/torrent/Last1, First1\; Last2, First2 -- Title, 3_e
 (1989, 2016).torrent
 }}}
-- 
Ticket URL: <http://dev.deluge-torrent.org/ticket/3647>
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 visit 
https://groups.google.com/d/msgid/deluge-dev/053.710c1d742710d564ad5f5bfd6cbeabca%40deluge-torrent.org.

Reply via email to