mirror of
https://github.com/beetbox/beets.git
synced 2025-12-27 11:02:43 +01:00
treat bpd command and args as strings, not bytes
This commit is contained in:
parent
f82f5f51a4
commit
a1edf1928d
1 changed files with 3 additions and 4 deletions
|
|
@ -640,8 +640,8 @@ class Command(object):
|
|||
"""A command issued by the client for processing by the server.
|
||||
"""
|
||||
|
||||
command_re = re.compile(br'^([^ \t]+)[ \t]*')
|
||||
arg_re = re.compile(br'"((?:\\"|[^"])+)"|([^ \t"]+)')
|
||||
command_re = re.compile(r'^([^ \t]+)[ \t]*')
|
||||
arg_re = re.compile(r'"((?:\\"|[^"])+)"|([^ \t"]+)')
|
||||
|
||||
def __init__(self, s):
|
||||
"""Creates a new `Command` from the given string, `s`, parsing
|
||||
|
|
@ -656,11 +656,10 @@ class Command(object):
|
|||
if match[0]:
|
||||
# Quoted argument.
|
||||
arg = match[0]
|
||||
arg = arg.replace(b'\\"', b'"').replace(b'\\\\', b'\\')
|
||||
arg = arg.replace('\\"', '"').replace('\\\\', '\\')
|
||||
else:
|
||||
# Unquoted argument.
|
||||
arg = match[1]
|
||||
arg = arg.decode('utf8')
|
||||
self.args.append(arg)
|
||||
|
||||
def run(self, conn):
|
||||
|
|
|
|||
Loading…
Reference in a new issue