小编pan*_*yap的帖子

json读取错误json.decoder.JSONDecodeError:无效\ escape

我正在编写代码,使用“ config.json”文件设置在solr中上传模型(train_and_upload_demo_model.py)。但我得到以下错误:

json.decoder.JSONDecodeError:无效\ escape:第11行第34列(字符461),这是此处的回溯:

D:\solr640\contrib\ltr\example>python train_and_upload_demo_model.py -c config.json

Traceback (most recent call last):
  File "train_and_upload_demo_model.py", line 182, in <module>
    sys.exit(main())
  File "train_and_upload_demo_model.py", line 158, in main
    config = json.load(configFile)
  File "C:\Users\Pankaj\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 299, in load
    parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
  File "C:\Users\Pankaj\AppData\Local\Programs\Python\Python36-32\lib\json\__init__.py", line 354, in loads
    return _default_decoder.decode(s)
  File "C:\Users\Pankaj\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 339, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\Pankaj\AppData\Local\Programs\Python\Python36-32\lib\json\decoder.py", line 355, in raw_decode
    obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Invalid \escape: line 11 column 34 (char 461)


content of …
Run Code Online (Sandbox Code Playgroud)

python parsing json solr

8
推荐指数
1
解决办法
8134
查看次数

curl xput windows无法从文件中读取数据

我使用命令propmpt在Windows中使用cURL.当我执行此命令时:

curl -XPUT "localhost:8983/solr/techproducts/schema/feature-store" --data-binary "@/path/myFeatures.json" -H "Content-type:application/json"
Run Code Online (Sandbox Code Playgroud)

我收到以下错误:

Warning: Couldn't read data from file "/path/myFeatures.json", this makes an
Warning: empty POST.
Run Code Online (Sandbox Code Playgroud)

我已更新文件权限,文件也出现在特定路径中.

可能的解决方案是什么?

json curl solr cmd

5
推荐指数
1
解决办法
9941
查看次数

标签 统计

json ×2

solr ×2

cmd ×1

curl ×1

parsing ×1

python ×1