#3041 closed bug (Invalid)
Execute plugin fails when filename contains two consecutive spaces
Reported by: | Max Amanshauser | Owned by: | |
---|---|---|---|
Priority: | minor | Milestone: | Future |
Component: | Plugin | Version: | 1.3.15 |
Keywords: | Cc: |
Description
The "name" option of a torrent is used for display purposes https://github.com/deluge-torrent/deluge/blob/develop/deluge/core/torrent.py#L128
In particular, it appears that several consecutive space (0x20) characters are coalesced into one. This can be easily verified by creating a torrent file for a file named
Untitled .txt
(note the two spaces) and then looking at the entry in the torrent list in e.g. WebUI, which is
Untitled .txt
(one space).
The file written to disk, however, retains the original name with two spaces. This becomes a problem when using the Execute plugin, because it reads the display name https://github.com/deluge-torrent/deluge/blob/develop/deluge/plugins/Execute/deluge/plugins/execute/core.py#L98, which then has no relation to the actual filename, rendering it useless for all file operations.
I am not entirely sure where the coalescing happens, perhaps here https://github.com/deluge-torrent/deluge/blob/develop/deluge/core/torrentmanager.py#L331, neither am I sure about the best way to correct this. If the coalescing is intentional for display purposes, then the Execute plugin probably should not read the name option and instead read the name of the top-most file of a torrent.
Change History (3)
comment:1 by , 7 years ago
Milestone: | needs verified → 1.3.16 |
---|
comment:2 by , 7 years ago
Resolution: | → Invalid |
---|---|
Status: | new → closed |
I must apologize, it appears this bug was a mirage due to a number of bugs in my own script. In fact, this is the result of a bug in the documentation of the Execute plugin that I blindly copied. Bash is very peculiar about whitespace and variables potentially containing multiple spaces must be double-quoted, otherwise mayhem ensues.
I fixed the documentation on the plugins page.