Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when saving #227

Open
diocas opened this issue Jun 7, 2023 · 3 comments
Open

Error when saving #227

diocas opened this issue Jun 7, 2023 · 3 comments
Labels
type:bug Something isn't working

Comments

@diocas
Copy link
Contributor

diocas commented Jun 7, 2023

Not sure what happened.. Opened a notebook, clicked save and got this:

[E 2023-06-07 16:22:20.363 ServerApp] Error saving: /eos/user/d/dalvesde/SWAN_projects/___DELETE2/Untitled.ipynb 'latin-1' codec can't encode character '\u2014' in position 564: Body ('—') is not valid Latin-1. Use body.encode('utf-8') if you want to send it encoded in UTF-8.

Not sure where the issue is coming.

@diocas diocas added the type:bug Something isn't working label Jun 7, 2023
@diocas
Copy link
Contributor Author

diocas commented Jun 7, 2023

The stranger thing is that I open the notebook, do nothing and try to immediately close it, and it says it has unsaved changes..

@piotrWichlinskiSoftwaremind
Copy link
Contributor

@diocas That's because we are using UTF-8 encoding while reading and writing a file:
https://github.com/sciencemesh/cs3api4lab/blob/ed1b9974730fa0624182ffb313f5b09bc3e31b34/cs3api4lab/api/cs3apismanager.py#LL426C21-L426C21

content += chunk.decode('utf-8')

@diocas
Copy link
Contributor Author

diocas commented Jun 21, 2023

Upstream does the same: https://github.com/jupyter-server/jupyter_server/blob/main/jupyter_server/services/contents/fileio.py#L332-L349

And with upstream I don't get this error... So something else is strange here...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants