AnswerDotAI / AnswerDotAI/nbdev

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

Open
#1,276 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Jupyter Notebook
Stars
5.3k
Forks
513
Avg merge
2d 30m
Merged PRs (30d)
8

Description

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.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.