AnswerDotAI / AnswerDotAI/nbdev

`nbdev_clean` fails to clean a notebook because it cannot decode some byte

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

Descrizione

I have been having issues with `nbdev_clean`. I narrowed down the notebook that is having problems being cleaned and the issue seems to be with quotation characters. In the below Copyright message (based on that from the `nbdev` repo), the quotations around the word `License` seem to be the center of the problem:

```markdown
Copyright © 2019 onward Hyun Jong Kim. Licensed under the Apache License, Version 2.0 (the “License”); you may not use this project’s files except in compliance with the License. A copy of the License is provided in the LICENSE file in this repository.
```

The following is the error message:

```powershell
(trouver_py310_venv) C:\Users\hyunj\Documents\Development\Python\trouver>nbdev_clean --fname nbs/index.ipynb
C:\Users\hyunj\Documents\Development\Python\trouver_py310_venv\lib\site-packages\nbdev\clean.py:115: UserWarning: Failed to clean notebook
warn(f'{warn_msg}')
C:\Users\hyunj\Documents\Development\Python\trouver_py310_venv\lib\site-packages\nbdev\clean.py:116: UserWarning: 'charmap' codec can't decode byte 0x9d in position 32929: character maps to
warn(e)
```

It may be relevant to note that I am using a Windows computer, the above error message was produced on command line, and that the editors I am using (VSCode to edit/read and Notepad++ to read) are set to encode files in UTF-8.

Beyond the block of text from the above diagnosis, the example that am working with is from [a library](https://github.com/hyunjongkimmath/trouver#readme) that I am developing using nbdev. The problem is not in the `master` branch (because I neglected to include a License statement), but rather is the `develop` branch.

**Edit**: I should add that the `develop` branch has since been updated and in particular, the quotation marks have been replaced with these ones: `""` and the error no longer arises. The quotation marks on the License statement above should still cause problems, however.

Guida per i contributori

Apri la guida per i contributori

Direzione di ricerca

Riproduci il fallimento con `nbdev_clean --fname nbs/index.ipynb` su Windows usando il testo del notebook mostrato. Ispeziona `nbdev/clean.py` intorno alla riga 115 e traccia l’errore di decodifica `charmap` segnalato; il lavoro è completato quando il notebook viene ripulito correttamente senza l’avviso del codec.

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

Valutazione

Stack tecnologico
jupyter, python
Ambito
tooling
Tipo di issue
Bug
Difficoltà
3/5
Tempo stimato
1-2 giorni
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
35/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.