mirror of
https://github.com/AsahiLinux/u-boot
synced 2024-11-10 23:24:38 +00:00
patman: Don't convert input data to unicode
The communication filter reads data in blocks and converts each block to unicode (if necessary) one at a time. In the unlikely event that a unicode character in the input spans a block this will not work. We get an error like: UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1022-1023: unexpected end of data There is no need to change the input to unicode, so the easiest fix is to drop this feature. Signed-off-by: Simon Glass <sjg@chromium.org> Tested-by: Philipp Tomsich <philipp.tomsich@theobroma-systems.com>
This commit is contained in:
parent
6f8abf765b
commit
5c724dc440
1 changed files with 0 additions and 4 deletions
|
@ -190,8 +190,6 @@ class Popen(subprocess.Popen):
|
|||
# We will get an error on read if the pty is closed
|
||||
try:
|
||||
data = os.read(self.stdout.fileno(), 1024)
|
||||
if isinstance(data, bytes):
|
||||
data = data.decode('utf-8')
|
||||
except OSError:
|
||||
pass
|
||||
if data == "":
|
||||
|
@ -207,8 +205,6 @@ class Popen(subprocess.Popen):
|
|||
# We will get an error on read if the pty is closed
|
||||
try:
|
||||
data = os.read(self.stderr.fileno(), 1024)
|
||||
if isinstance(data, bytes):
|
||||
data = data.decode('utf-8')
|
||||
except OSError:
|
||||
pass
|
||||
if data == "":
|
||||
|
|
Loading…
Reference in a new issue