[Deluge] #3647: deluge console errors on addition of torrent with `; ` in name

4 views
Skip to first unread message

Deluge

unread,
Apr 30, 2025, 9:01:06 AMApr 30
to delug...@googlegroups.com
#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

Deluge

unread,
Apr 30, 2025, 9:01:44 AMApr 30
to delug...@googlegroups.com
#3647: deluge console errors on addition of torrent with semicolon (`;`) in name
-----------------------------+----------------------------
Reporter: iconoclasthero | Owner: (none)

Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.5
Resolution: | Keywords:
-----------------------------+----------------------------
Changes (by iconoclasthero):

* summary: deluge console errors on addition of torrent with `;` in name
=>
deluge console errors on addition of torrent with semicolon (`;`) in
name

--
Ticket URL: <http://dev.deluge-torrent.org/ticket/3647#comment:1>

Deluge

unread,
Apr 30, 2025, 9:05:31 AMApr 30
to delug...@googlegroups.com
#3647: deluge console errors on addition of torrent with semicolon (`;`) in name
-----------------------------+----------------------------
Reporter: iconoclasthero | Owner: (none)
Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.5
Resolution: | Keywords:
-----------------------------+----------------------------
Comment (by iconoclasthero):

NB:
the @Q wraps the semicolon-containing string in single quotes which I
thought should be enough:
{{{
echo "${torrentfile@Q}"
'/library/torrent/Last1, First1; Last2, First2 -- Title, 3_e (1989,
2016).torrent'
}}}
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/3647#comment:2>

Deluge

unread,
Apr 30, 2025, 9:18:51 AMApr 30
to delug...@googlegroups.com
#3647: deluge console errors on addition of torrent with semicolon (`;`) in name
-----------------------------+----------------------------
Reporter: iconoclasthero | Owner: (none)
Type: bug | Status: new
Priority: minor | Milestone: needs verified
Component: Unknown | Version: 2.0.5
Resolution: | Keywords:
-----------------------------+----------------------------
Comment (by iconoclasthero):

Also this fails...
{{{
$ deluge-console "connect $delugehost:$delugeport $delugeuser $delugepass;
add -p ${linked@Q} \"${torrentfile//\;/\\\;}\""

File "/usr/lib/python3.12/shlex.py", line 210, in read_token
raise ValueError("No escaped character")
ValueError: No escaped character
}}}

defining "$torrentfile" as also does not work:
{{{
torrentfile=/library/torrent/Last1\,\ First1\;\ Last2\,\ First2\ --\
Title\,\ 3_e\ \(1989\,\ 2016\).torrent
}}}
--
Ticket URL: <http://dev.deluge-torrent.org/ticket/3647#comment:3>

Reply all
Reply to author
Forward
0 new messages