affggh/Magisk_patcher

img在中文路径将会无法解包

Nu11Const opened this issue · 0 comments

目前为最新版
报错如下:

Exception in thread Thread-1 (patch):
Traceback (most recent call last):
  File "D:\Anaconda\Lib\threading.py", line 1038, in _bootstrap_inner
    self.run()
  File "D:\Anaconda\Lib\threading.py", line 975, in run
    self._target(*self._args, **self._kwargs)
  File "E:\Magisk_patcher\mp\boot_patch.py", line 115, in patch
    err, ret = self.__execv(["unpack", bootimg])
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "E:\Magisk_patcher\mp\boot_patch.py", line 104, in __execv
    logging.info(ret.stdout.decode())
                 ^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc1 in position 64: invalid start byte

发现出现错误路径在/mp/boot_patch.py的这两行:

logging.info(ret.stdout.decode())
return ret.returncode, ret.stdout.decode()

解决方案:
添加encoding="utf-8"。
稍后将开Pull Request.