AnswerDotAI / AnswerDotAI/nbdev

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

Abierto
#1,276 2 comentarios 0 reacciones 0 asignados Ver en GitHub
Lenguaje dominante
Jupyter Notebook
Estrellas
5.3k
Forks
514
Merge medio
2 d 30 min
PR fusionados (30 d)
8

Descripción

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.

Guía de contribución

Abrir la guía de contribución

Línea de trabajo

Reproduce el fallo con `nbdev_clean --fname nbs/index.ipynb` en Windows usando el texto del notebook mostrado. Inspecciona `nbdev/clean.py` alrededor de la línea 115 y sigue el error de decodificación `charmap` indicado; la tarea está terminada cuando el notebook se limpia correctamente sin la advertencia del codec.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
jupyter, python
Área
tooling
Tipo de issue
Error
Dificultad
3/5
Tiempo estimado
1-2 días
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.