AnswerDotAI / AnswerDotAI/nbdev

nbdev_new: json.decoder.JSONDecodeError: Expecting ',' delimiter: line 19 column 41 (char 323)

Aperta
#1,360 1 commento 0 reazioni 0 assegnatari Vedi su GitHub
bug
Lingua principale
Jupyter Notebook
Stelle
5.3k
Fork
513
Merge medio
2g 30m
PR unite (30g)
8

Descrizione

On creating a new nbdev project with the `nbdev_new` command, after cloning into an empty git repo as described in the [tutorial](https://nbdev.fast.ai/tutorials/tutorial.html#initialise-your-repo-with-nbdev), I get the following error:

Traceback (most recent call last):
File "/home/ndev_env/bin/nbdev_new", line 8, in
sys.exit(nbdev_new())
File "/home/ndev_env/lib/python3.9/site-packages/fastcore/script.py", line 119, in _f
return tfunc(**merge(args, args_from_prog(func, xtra)))
File "/home/ndev_env/lib/python3.9/site-packages/nbdev/cli.py", line 108, in nbdev_new
nbdev_export.__wrapped__()
File "/home/ndev_env/lib/python3.9/site-packages/nbdev/doclinks.py", line 134, in nbdev_export
for f in files: nb_export(f)
File "/home/ndev_env/lib/python3.9/site-packages/nbdev/export.py", line 48, in nb_export
nb = NBProcessor(nbname, [exp]+L(procs), debug=debug)
File "/home/ndev_env/lib/python3.9/site-packages/nbdev/process.py", line 92, in __init__
self.nb = read_nb(path) if nb is None else nb
File "/home/ndev_env/lib/python3.9/site-packages/execnb/nbio.py", line 57, in read_nb
res = dict2nb(_read_json(path, encoding='utf-8'))
File "/home/ndev_env/lib/python3.9/site-packages/execnb/nbio.py", line 16, in _read_json
return loads(Path(self).read_text(encoding=encoding, errors=errors))
File "/home/ndev_env/lib/python3.9/json/__init__.py", line 346, in loads
return _default_decoder.decode(s)
File "/home/ndev_env/lib/python3.9/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/ndev_env/lib/python3.9/json/decoder.py", line 353, in raw_decode
obj, end = self.scan_once(s, idx)
json.decoder.JSONDecodeError: Expecting ',' delimiter: line 19 column 41 (char 323)

The same error gets triggered when I try to export any notebooks within this project using the `nbdev_export` command. I saw [this issue](https://forums.fast.ai/t/nbdev-export-raises-jsondecodeerror/103606), but changing the python encoding environment variable doesn't work for me. I am running Linux.

Here is a [link](https://github.com/stroopwafl/toolformer/actions/runs/5599975826/jobs/10241683644) to the GitHub action for the failed test upon commit.

Has anyone seen or solved this before?

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproducete il fallimento con nbdev_new in un repository vuoto clonato, quindi esaminate il JSON del notebook generato intorno alla riga 19 e seguite gli entry point indicati in nbdev/cli.py, nbdev/doclinks.py, nbdev/export.py ed execnb/nbio.py. La correzione è completa quando nbdev_new e nbdev_export vengono eseguiti correttamente sul progetto segnalato e la GitHub Action che ha avuto esito negativo non genera più JSONDecodeError.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
jupyter-notebook, python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
4/5
Tempo stimato
3-5 giorni
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.