From what I can tell, the execute plugin doesn't properly escape ampersands ("&") found in a torrent name and therefore my batch file is failing. I checked the deluge log file to see if it could show exactly what the plugin is using as the command line but it doesn't (at least at default logging level).
Does the execute plugin escape the ampersand?
Is there a way to see exactly what command line is being used for a given torrent?
Execute plugin handling ampersands in torrent names: windows
-
- Leecher
- Posts: 56
- Joined: Sun Jun 23, 2013 4:16 pm
-
- Leecher
- Posts: 56
- Joined: Sun Jun 23, 2013 4:16 pm
Re: Execute plugin handling ampersands in torrent names: win
Wondering about this limitation again. I'm tempted to download source and attempt a fix. Could a fix potentially be committed into the source repository? Hoping to get tentative approval since that would help motivate me to go to the trouble.
Re: Execute plugin handling ampersands in torrent names: win
The torrent name is utf8 encoded, it is your script that needs to handle the filename correctly.
-
- Leecher
- Posts: 56
- Joined: Sun Jun 23, 2013 4:16 pm
Re: Execute plugin handling ampersands in torrent names: win
No, I'm not talking about encoding. I'm talking about escaping.
-
- Leecher
- Posts: 56
- Joined: Sun Jun 23, 2013 4:16 pm
Re: Execute plugin handling ampersands in torrent names: win
To expand on my prior post, I'm talking about escaping required by the Windows OS command line. Unless an ampersand is escaped, Windows interprets it as separating 2 commands, so it runs everything before the ampersand as one command and everything after it as another command (ref: http://www.robvanderwoude.com/condexec.php). So when the execute plugin tries to run a command and the filename has an ampersand in it, Windows tries to run it as 2 separate and partial commands.
I have tested my script by calling it manually, and if it is called with the ampersand properly escaped, my script works fine. So the problem isn't my script as you suggested. And it's not an encoding issue. It's a Windows-specific command line escaping issue with the plugin.
http://stackoverflow.com/questions/1402 ... -parameter
I have tested my script by calling it manually, and if it is called with the ampersand properly escaped, my script works fine. So the problem isn't my script as you suggested. And it's not an encoding issue. It's a Windows-specific command line escaping issue with the plugin.
http://stackoverflow.com/questions/1402 ... -parameter
Re: Execute plugin handling ampersands in torrent names: win
Ok that makes more sense now. It should be a case of double-quoting the parameters passed to getProcessOutputAndValue.
-
- Leecher
- Posts: 56
- Joined: Sun Jun 23, 2013 4:16 pm
Re: Execute plugin handling ampersands in torrent names: win
Cool. So then the question is how to move forward. Is that something you want to fix? If not, can I fix it and submit it for inclusion in future releases? I would prefer the former since I would have to ramp up on deluge development but if it'll only get done if I do it myself, I'm willing to give it a shot.
Re: Execute plugin handling ampersands in torrent names: win
I can fix it but it's not something I will be fixing in the immediate future, especially since it's a Windows issue. It's up to you but Deluge development is fun
Ticket so it doesn't get forgotten about: http://dev.deluge-torrent.org/ticket/2784
Ticket so it doesn't get forgotten about: http://dev.deluge-torrent.org/ticket/2784