Skip to content

Conversation

@daizutabi
Copy link
Contributor

📝 Summary

Fixes #6434.
Fixes a UnicodeEncodeError on Windows by specifying UTF-8 encoding when writing TOML files.

🔍 Description of Changes

This pull request addresses an issue where saving a marimo notebook on Windows with a file path containing non-ASCII characters would result in a UnicodeEncodeError.

The error was caused by the write_toml function in marimo/_utils/config/config.py, which did not specify the file encoding when writing the TOML configuration. This led to issues on operating systems where the default encoding is not UTF-8.

The fix involves explicitly setting the encoding to utf-8 in the write_text method call within the write_toml function. This ensures consistent behavior across all platforms and prevents encoding-related errors.

📋 Checklist

  • I have read the contributor guidelines.
  • For large changes, or changes that affect the public API: this change was discussed or approved through an issue, on Discord, or the community discussions (Please provide a link if applicable).
  • I have added tests for the changes made.
  • I have run the code and verified that it works as expected.

This fixes a `UnicodeEncodeError` on Windows when saving notebooks with non-ASCII characters in file paths.
@vercel
Copy link

vercel bot commented Sep 19, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
marimo-docs Ready Ready Preview Comment Sep 19, 2025 7:54pm

@mscolnick mscolnick merged commit b149025 into marimo-team:main Sep 19, 2025
36 of 37 checks passed
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.

Encoding error when saving notebooks with non-ASCII characters in file paths on Windows

2 participants