2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2025-06-03 03:50:08 +00:00

Fix python error, TypeError: cannot use a string pattern on a bytes-like object (#6137)

This commit is contained in:
Gᴏɴɢ Jie 2019-03-20 18:06:15 +08:00 committed by yangsong
parent 8299f85624
commit 4435960f4a

View File

@ -77,7 +77,7 @@ try:
received = newSocket.recv(200)
if not received:
break
command = re.split('\s+',received)
command = re.split(b'\s+',received)
if(command[0] == b"stat"):
ilog = ""
line = ""
@ -113,10 +113,10 @@ try:
newSocket.send(line.encode())
break
#UNCOMMENTOENABLEDEBUGPORT# if(command[0] == b"sh"): #DEBUG purposes only, wide open root priv command here.
#UNCOMMENTOENABLEDEBUGPORT# newcommand = ""
#UNCOMMENTOENABLEDEBUGPORT# newcommand = b""
#UNCOMMENTOENABLEDEBUGPORT# for i in command[1:]:
#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + " "
#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand).read()
#UNCOMMENTOENABLEDEBUGPORT# newcommand = newcommand + i + b" "
#UNCOMMENTOENABLEDEBUGPORT# output = os.popen(newcommand.decode('utf-8')).read()
#UNCOMMENTOENABLEDEBUGPORT# newSocket.send(output.encode())
#UNCOMMENTOENABLEDEBUGPORT# break
if(command[0] == b"screendump"):