mirror of
https://github.com/beetbox/beets.git
synced 2026-01-06 16:02:53 +01:00
bpd: Process commands as bytes (fix #1388)
This commit is contained in:
parent
882723a0bf
commit
8ae0317014
1 changed files with 3 additions and 3 deletions
|
|
@ -639,8 +639,8 @@ class Command(object):
|
|||
"""A command issued by the client for processing by the server.
|
||||
"""
|
||||
|
||||
command_re = re.compile(r'^([^ \t]+)[ \t]*')
|
||||
arg_re = re.compile(r'"((?:\\"|[^"])+)"|([^ \t"]+)')
|
||||
command_re = re.compile(br'^([^ \t]+)[ \t]*')
|
||||
arg_re = re.compile(br'"((?:\\"|[^"])+)"|([^ \t"]+)')
|
||||
|
||||
def __init__(self, s):
|
||||
"""Creates a new `Command` from the given string, `s`, parsing
|
||||
|
|
@ -655,7 +655,7 @@ class Command(object):
|
|||
if match[0]:
|
||||
# Quoted argument.
|
||||
arg = match[0]
|
||||
arg = arg.replace('\\"', '"').replace('\\\\', '\\')
|
||||
arg = arg.replace(b'\\"', b'"').replace(b'\\\\', b'\\')
|
||||
else:
|
||||
# Unquoted argument.
|
||||
arg = match[1]
|
||||
|
|
|
|||
Loading…
Reference in a new issue