收藏
回答

minium更新到1.2.0的时候获取系统信息的时候报错是怎么回事呢?

minium的版本是1.2.0的

运行以上代码的时候报了下面的错

重新安装会1.0.6的版本运行以上代码的时候就能正常运行不会报错

Traceback (most recent call last):

  File "E:\pycharm\winxuanjiuyue\demo.py", line 12, in <module>

    mini = minium.Minium({

  File "D:\Programs\Python\Python39\lib\site-packages\minium\__init__.py", line 20, in Minium

    return get_minium_driver(conf, *args, **kwargs)

  File "D:\Programs\Python\Python39\lib\site-packages\minium\miniprogram\__init__.py", line 28, in get_minium_driver

    return APP[application](conf, *args, **kwargs)

  File "D:\Programs\Python\Python39\lib\site-packages\minium\miniprogram\wx_minium.py", line 110, in __init__

    self.launch_dev_tool()

  File "D:\Programs\Python\Python39\lib\site-packages\minium\miniprogram\base_driver\minium_log.py", line 135, in wrapper

    result = func(*args, **kwargs)

  File "D:\Programs\Python\Python39\lib\site-packages\minium\miniprogram\wx_minium.py", line 200, in launch_dev_tool

    self._get_sdk_version()

  File "D:\Programs\Python\Python39\lib\site-packages\minium\miniprogram\wx_minium.py", line 166, in _get_sdk_version

    self.sdk_version = json.loads(fd.read().strip()).get("libVersion", None)

UnicodeDecodeError: 'gbk' codec can't decode byte 0xaf in position 1497: illegal multibyte sequence

回答关注问题邀请回答
收藏

3 个回答

  • yopofeng
    yopofeng
    2021-10-11

    fixed,请更新下包

    2021-10-11
    有用
    回复 3
    • HuAaa
      HuAaa
      2021-10-11
      还是存在该问题  更新了1.2.1版本的包
      2021-10-11
      回复
    • 立早
      立早
      2021-11-12回复HuAaa
      你好,你的解决了吗?我更新到1.2.1也是有问题
      2021-11-12
      回复
    • HuAaa
      HuAaa
      2021-12-05回复立早
      并没有解决 依旧存在该问题。暂时用的1.0.9版本的包进行测试
      2021-12-05
      回复
  • 阳光正好
    阳光正好
    2021-10-12
    def _get_sdk_version(self):
        # read from project.config.json
        if self.project_path and os.path.isfile(
            os.path.join(self.project_path, "project.config.json")
        ):
            with open(os.path.join(self.project_path, "project.config.json"), "r") as fd:
                self.sdk_version = json.loads(fd.read().strip()).get("libVersion", None)
    
    
    点击报错的的位置,将wx_minium.py文件的该行代码 with open(os.path.join(self.project_path, "project.config.json"), "r") as fd:的读取模式修改为"rb"试一下。
    
    2021-10-12
    有用 1
    回复
  • HuAaa
    HuAaa
    2021-10-11

    遇到同样的问题,请问解决了吗

    2021-10-11
    有用
    回复 2
    • yopofeng
      yopofeng
      2021-10-11
      fixed,请更新下包
      2021-10-11
      回复
    • 晓謝
      晓謝
      2021-10-20
      重新安装了minium之后,已经没问题了
      2021-10-20
      回复
登录 后发表内容