marimo-team / marimo

A reactive notebook for Python — run reproducible experiments, execute as a script, deploy as an app, and version with git.
https://marimo.io
Apache License 2.0
5.43k stars 165 forks source link

when cell is running, marimo add some "invalid non-printable character U+00A0" #1546

Closed shuimei closed 1 month ago

shuimei commented 1 month ago

Describe the bug

I am writing a cell to run in browser, but when I clicked button "run", marimo responses with this info:

This cell wasn't run because it has errors
line 4 def db_inspect(engine):     ^ SyntaxError: invalid non-printable character U+00A0

This always happens when I try to run a simple script in a cell image and I have to delete the blank characters manually.

And I find it that this can happen when the marimo file changed.

Environment

{ "marimo": "0.6.13", "OS": "Linux", "OS Version": "5.15.133.1-microsoft-standard-WSL2", "Processor": "x86_64", "Python Version": "3.10.12", "Binaries": { "Browser": "--", "Node": "v20.12.0" }, "Requirements": { "click": "8.1.7", "importlib-resources": "6.4.0", "jedi": "0.18.0", "markdown": "3.6", "pymdown-extensions": "10.8.1", "pygments": "2.17.2", "tomlkit": "0.12.4", "uvicorn": "0.23.2", "starlette": "0.36.3", "websocket": "missing", "typing-extensions": "4.10.0", "black": "24.3.0" } }

Code to reproduce

any code can reproduce this error

akshayka commented 1 month ago

Thanks for reporting! That's unfortunate.

Just to confirm, you're not editing the marimo file in a text editor -- this is just when you edit in the browser and click run?

akshayka commented 1 month ago

@shuimei, a couple of more follow up questions:

  1. What browser are you using?
  2. Does this happen after typing any code in the cell, or only after copy-pasting?