mirror of
https://github.com/avrdudes/avrdude.git
synced 2026-09-29 04:18:54 +03:00
Make the reporting functions a bit more robust
Sometimes, non-ASCII characters might appear in message strings, causing a UTF-8 decoding error. Catch it, so the remainder can proceed.
This commit is contained in:
@@ -177,10 +177,14 @@ def msg_callback(target: str, lno: int, fname: str, func: str,
|
||||
elif (msgmode & ad.MSG2_INDENT2) != 0:
|
||||
s = (len(ad.cvar.progname) + 2) * ' '
|
||||
s += msg
|
||||
print(s, end='')
|
||||
try:
|
||||
print(s, end='')
|
||||
except UnicodeDecodeError:
|
||||
print("message contained invalid characters")
|
||||
|
||||
# very simplified progress callback
|
||||
global prog_hdr
|
||||
prog_hdr = ""
|
||||
def progress_callback(percent: int, etime: float, hdr: str, finish: int):
|
||||
if hdr:
|
||||
global prog_hdr
|
||||
|
||||
Reference in New Issue
Block a user