mirror of
https://opendev.org/x/pyghmi
synced 2025-08-24 12:00:21 +00:00
Fix console input with unicode
If unicode data comes in, coerce it to utf8 so it can be concatenated to a bytearray. Change-Id: Idfefbd8d89a817b3c93daa295c76ab829d2be8d3
This commit is contained in:
@@ -258,7 +258,11 @@ class Console(object):
|
||||
breakbyte = 0
|
||||
if sendbreak:
|
||||
breakbyte = 0b10000
|
||||
payload = bytearray((self.myseq, 0, 0, breakbyte)) + output
|
||||
try:
|
||||
payload = bytearray((self.myseq, 0, 0, breakbyte)) + output
|
||||
except TypeError: # bytearray hits unicode...
|
||||
payload = bytearray((self.myseq, 0, 0, breakbyte
|
||||
)) + output.encode('utf8')
|
||||
self.lasttextsize = len(output)
|
||||
needskeepalive = False
|
||||
if self.lasttextsize == 0:
|
||||
|
Reference in New Issue
Block a user