【问题标题】:OSError: stream operation not supported ujson_loadOSError:不支持流操作 ujson_load
【发布时间】:2023-02-13 16:04:35
【问题描述】:

我的 python 代码中出现以下错误:

  File "main.py", line 55, in <module>
  File "/flash/lib/OTA.py", line 54, in update
  File "/flash/lib/OTA.py", line 49, in get_update_manifest
OSError: stream operation not supported

出问题的代码:

    def get_update_manifest(self):
        print(self.get_current_version())
        req = "manifest.json?current_ver={}".format(self.get_current_version())
        manifest_data = self.get_data(req).decode()
        print(manifest_data)
        manifest = ujson.load(manifest_data)
        gc.collect()
        return manifest

在以下文件夹中,您将找到我的代码:https://github.com/antec1/Control_Unit

如果你能帮助我摆脱这个错误,那将是非常友好的。

【问题讨论】:

    标签: python json ota oserror


    【解决方案1】:

    使用 ujson.loads() 而不是 ujson.load() 从字符串加载

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-09-11
      • 2020-05-24
      • 2014-06-30
      • 1970-01-01
      • 1970-01-01
      • 2019-04-17
      • 2018-09-11
      • 1970-01-01
      相关资源
      最近更新 更多