I'm executing a command in python using:
command = os.popen("sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m").read()
I'm trying to create a bootable USB device with diskutil but I'm getting this error and I don't know how to fix it
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x90 in position 4: invalid start byte
EDIT
I solved by myself using subprocess event:
subprocess.check_output("command","to","execute"]).decode(errors='ignore')