Fix python3 encoding issues for remote commands
Change-Id: Idb377eae4a2b52760cb810b590a75b5aea522968
This commit is contained in:
parent
d92570abd4
commit
2f9eebc211
|
@ -374,12 +374,12 @@ class App(object):
|
||||||
try:
|
try:
|
||||||
s, addr = self.socket.accept()
|
s, addr = self.socket.accept()
|
||||||
self.log.debug("Accepted socket connection %s" % (s,))
|
self.log.debug("Accepted socket connection %s" % (s,))
|
||||||
buf = ''
|
buf = b''
|
||||||
while True:
|
while True:
|
||||||
buf += s.recv(1)
|
buf += s.recv(1)
|
||||||
if buf[-1] == '\n':
|
if buf[-1] == 10:
|
||||||
break
|
break
|
||||||
buf = buf.strip()
|
buf = buf.decode('utf8').strip()
|
||||||
self.log.debug("Received %s from socket" % (buf,))
|
self.log.debug("Received %s from socket" % (buf,))
|
||||||
s.close()
|
s.close()
|
||||||
parts = buf.split()
|
parts = buf.split()
|
||||||
|
@ -874,7 +874,7 @@ class OpenChangeAction(argparse.Action):
|
||||||
|
|
||||||
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
|
||||||
s.connect(cf.socket_path)
|
s.connect(cf.socket_path)
|
||||||
s.sendall('open %s\n' % url)
|
s.sendall(('open %s\n' % url).encode('utf8'))
|
||||||
sys.exit(0)
|
sys.exit(0)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
|
|
Loading…
Reference in New Issue