jupyterlite / xeus

JupyterLite loader for Xeus kernels
https://jupyterlite-xeus.readthedocs.io
BSD 3-Clause "New" or "Revised" License
20 stars 11 forks source link

UnicodeEncodeError on open() #60

Closed katotetsuro closed 6 months ago

katotetsuro commented 6 months ago

Description

This may not be the problem with jupyterlite-xeus, If I try to open a file with a path that contains Unicode characters, such as open('あ'), I get a UnicodeEncodeError.

Reproduce

  1. Go to https://jupyterlite-xeus.readthedocs.io/en/latest/
  2. execute open('あ')
  3. UnicodeEncodeError: 'ascii' codec can't encode character '\u3042' in position 14: ordinal not in range(128)

Context

import locale
locale.getencoding()
> 'ASCII'

Unlike pyodide, the result of locale.getencoding() is 'ASCII', so if I could set the locale somewhere, it would solve the problem.

Is the locale in empack or conda env affecting it?

katotetsuro commented 6 months ago

This problem seems to be resolved now, I thought it was a python issue on emscripten-forge, but it doesn't seem to have been specifically updated 🤔