AnswerDotAI / AnswerDotAI/nbdev

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

Offen
#1,276 2 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
Jupyter Notebook
Sterne
5.3k
Forks
513
Ø Merge
2 T. 30 Min.
Gemergte PRs (30 T.)
8

Beschreibung

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.

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduziere den Fehler mit `nbdev_clean --fname nbs/index.ipynb` unter Windows unter Verwendung des gezeigten Notebook-Texts. Untersuche `nbdev/clean.py` um Zeile 115 und verfolge den gemeldeten `charmap`-Decodierungsfehler zurück; abgeschlossen ist die Aufgabe, wenn das Notebook ohne die Codec-Warnung erfolgreich bereinigt wird.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
jupyter, python
Bereich
tooling
Issue-Typ
Bug
Schwierigkeit
3/5
Geschätzter Aufwand
1-2 Tage
Aktivitätsstatus
Veraltet
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
35/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.