mirror of
				https://github.com/xcat2/xcat-core.git
				synced 2025-10-31 11:22:27 +00:00 
			
		
		
		
	Fix python error, TypeError: cannot use a string pattern on a bytes-like object (#6137)
This commit is contained in:
		| @@ -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"): | ||||
|   | ||||
		Reference in New Issue
	
	Block a user