Skip to content

Conversation

@mapix-etnc
Copy link

Fixes UnicodeDecodeError when kernel processes messages containing non-ASCII characters (e.g., UTF-8 paths, locale-specific metadata).

The Jupyter protocol uses UTF-8 encoding for JSON messages by default (RFC 8259), but load_bytes() was hardcoded to use ASCII decoding.

This caused kernel crashes for users with:

  • Non-ASCII usernames or paths
  • Non-English system locales
  • Any workspace containing UTF-8 characters

Changes:

  • xonsh_jupyter/kernel.py:38: b.decode('ascii') -> b.decode('utf-8')

Impact: Makes xonsh kernel usable in international environments.

Fixes UnicodeDecodeError when kernel processes messages containing
non-ASCII characters (e.g., UTF-8 paths, locale-specific metadata).

The Jupyter protocol uses UTF-8 encoding for JSON messages by default
(RFC 8259), but load_bytes() was hardcoded to use ASCII decoding.

This caused kernel crashes for users with:
- Non-ASCII usernames or paths
- Non-English system locales
- Any workspace containing UTF-8 characters

Changes:
- xonsh_jupyter/kernel.py:38: b.decode('ascii') -> b.decode('utf-8')

Impact: Makes xonsh kernel usable in international environments.
@anki-code anki-code self-requested a review November 21, 2025 10:52
@anki-code anki-code merged commit 3646c18 into xonsh:main Nov 21, 2025
9 of 10 checks passed
@anki-code
Copy link
Member

Thanks @mapix-etnc !

@anki-code
Copy link
Member

@jnoortheen please make a new release. Thanks!

@jnoortheen
Copy link
Member

@anki-code done! https://github.com/xonsh/xontrib-jupyter/releases/tag/v0.3.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants