-
Notifications
You must be signed in to change notification settings - Fork 414
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
Cannot save on Windows if file path contains "&" character #3761
Comments
Co-Authored-By: Myles Scolnick <[email protected]>
Fix Windows path encoding for special characters (#3761) This PR fixes an issue where marimo fails to save files on Windows when the file path contains special characters like '&'. Changes: - Updated `_rename_file` in file_manager.py to use pathlib.Path for cross-platform path handling - Added Windows-specific test to verify special character handling Test Results: - All existing tests pass (20 passed) - New Windows-specific test added (skipped on non-Windows platforms) - Manual verification on Windows required for special character handling Fixes #3761 Link to Devin run: https://app.devin.ai/sessions/6509c2c682564aa9910483478a642ed5 Requested by: Myles --------- Co-authored-by: Devin AI <158243242+devin-ai-integration[bot]@users.noreply.github.com> Co-authored-by: Myles Scolnick <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Hi @mscolnick D:\>marimo env
Exception in thread Thread-2 (_readerthread):
Traceback (most recent call last):
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1073, in _bootstrap_inner
self.run()
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\threading.py", line 1010, in run
self._target(*self._args, **self._kwargs)
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\subprocess.py", line 1597, in _readerthread
buffer.append(fh.read())
^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\encodings\cp1252.py", line 23, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 41: character maps to <undefined>
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Scripts\marimo.exe\__main__.py", line 7, in <module>
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1157, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1078, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1688, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 1434, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\click\core.py", line 783, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\marimo\_cli\cli.py", line 788, in env
click.echo(json.dumps(get_system_info(), indent=2))
^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\marimo\_cli\envinfo.py", line 61, in get_system_info
"Browser": get_chrome_version() or "--",
^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\marimo\_utils\health.py", line 129, in get_chrome_version
return get_chrome_version_windows()
^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Users\redacted\AppData\Local\Programs\Python\Python312\Lib\site-packages\marimo\_utils\health.py", line 98, in get_chrome_version_windows
return stdout.strip().split()[-1]
~~~~~~~~~~~~~~~~~~~~~~^^^^
IndexError: list index out of range |
I re-opened the issue. Apologies, we have trouble testing on windows. Any chance you'd be able to help debug / write a failing tests for us, so that we can fix it? |
For the |
Windows only. Problem posted in #3761
Describe the bug
I tried to create a notebook in a folder that contains a "&" character which is obviously allowed in Windows.
The folder name is displayed as
D:\Temp\test space\test&space\test_ma.py
in marimo.Windows shows it as
D:\Temp\test space\test&space\test_ma.py
Marimo displays an error message:

"Failed to save" "Save handler cannot rename files."
Console output shows
'charmap' codec can't encode character '\x85' in position 84: character maps to <undefined>
marimo works when there is no "&" in the folder path.
I cannot rename the folder because this is on a shared drive where other people also have access.
"marimo env" also crashed in the console.
starting a new console gave the desired output
Environment
Code to reproduce
import pandas
The text was updated successfully, but these errors were encountered: