def load(fp, **kwargs): """Like :func:`loads` but reads from a file object. """ _load_arg_defaults(kwargs) if not PY2: fp = _wrap_reader_for_text(fp, kwargs.pop('encoding', None) or 'utf-8') return _json.load(fp, **kwargs)
def load(fp, app=None, **kwargs): """Like :func:`loads` but reads from a file object.""" _load_arg_defaults(kwargs, app=app) if not PY2: fp = _wrap_reader_for_text(fp, kwargs.pop("encoding", None) or "utf-8") return _json.load(fp, **kwargs)
def load_json_config(file): assert file.endswith(".json") assert os.path.exists(file), "%s profile is missing" % file with open(file, "r", encoding="utf-8") as fp: data = json.load(fp) return ImmutableDict(data)
def _load(fp, **kw): if not PY2: fp = _wrap_reader_for_text(fp, kw.pop('encoding', None) or 'utf-8') return _json.load(fp, **kw)
def load(fp, **kwargs): """类似 :func:`loads` 函数,但从一个文件对象来读取内容.""" _load_arg_defaults(kwargs) if not PY2: fp = _wrap_reader_for_text(fp, kwargs.pop('encoding', None) or 'utf-8') return _json.load(fp, **kwargs)