mirror of
https://github.com/beetbox/beets.git
synced 2025-12-30 04:22:40 +01:00
convert: Split command in str form
...with yet another round-trip conversion. :/
This commit is contained in:
parent
2f5f9ea174
commit
e6a1f5a3dc
1 changed files with 8 additions and 1 deletions
|
|
@ -206,8 +206,15 @@ class ConvertPlugin(BeetsPlugin):
|
|||
source = decode_commandline_path(source)
|
||||
dest = decode_commandline_path(dest)
|
||||
|
||||
# Split the command using shell syntax. We need to pass the
|
||||
# string through a `str` because, at least on some Python
|
||||
# versions, shlex.split does not support bytes.
|
||||
args = [
|
||||
a.encode('utf8', 'surrogateescape')
|
||||
for a in shlex.split(command.decode('utf8', 'surrogateescape'))
|
||||
]
|
||||
|
||||
# Substitute $source and $dest in the argument list.
|
||||
args = shlex.split(command)
|
||||
encode_cmd = []
|
||||
for i, arg in enumerate(args):
|
||||
args[i] = Template(arg).safe_substitute({
|
||||
|
|
|
|||
Loading…
Reference in a new issue