We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Suggestion: Specify the character set as utf-8 when opening the file in the file config.py, or use character set detection.
[runner] # 禁止掉 magic commands magicEnabled = false
streamlit run xxx.py
get error
File "c:\python38_64\lib\site-packages\streamlit\hashing.py", line 40, in <module> from streamlit.folder_black_list import FolderBlackList File "c:\python38_64\lib\site-packages\streamlit\folder_black_list.py", line 39, in <module> if config.get_option("global.developmentMode"): File "c:\python38_64\lib\site-packages\streamlit\config.py", line 104, in get_option config_options = get_config_options() File "c:\python38_64\lib\site-packages\streamlit\config.py", line 1055, in get_config_options file_contents = input.read() UnicodeDecodeError: 'gbk' codec can't decode byte 0xad in position 6: illegal multibyte sequence
caused by config.py ,code snippet:
with open(filename, "r") as input: file_contents = input.read()
Treatment method:
with open(filename, "r",encoding='utf-8') as input: file_contents = input.read()
The text was updated successfully, but these errors were encountered:
This reminds me of #2615. Might be worth us auditing git grep open\( across the board for this kind of issue.
git grep open\(
Sorry, something went wrong.
Good code practice, just like Golang source file must be encoded in UTF-8.
I did a little more research and found some interesting things:
PYTHONUTF8
Thanks for the report @yinhedot ! I think @jroes is right! We should just default to UTF-8.
vdonato
Successfully merging a pull request may close this issue.
Summary
Suggestion: Specify the character set as utf-8 when opening the file in the file config.py, or use character set detection.
Steps to reproduce
streamlit run xxx.py
get error
caused by config.py ,code snippet:
Treatment method:
The text was updated successfully, but these errors were encountered: