Fix causing Hot Reload (#8070) (#8075)

* Fix bug causing Hot Reload failure in code containing non-English languages due to missing encoding specification (#8070)

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
This commit is contained in:
Toru Suzuki 2024-04-20 01:44:18 +09:00 committed by GitHub
parent 72f4ca88ab
commit 5d9db89aa6
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"gradio": patch
---
fix:Fix causing Hot Reload (#8070)

View File

@ -169,7 +169,7 @@ def _remove_no_reload_codeblocks(file_path: str):
file_path (str): The path to the file to remove the no_reload code blocks from.
"""
with open(file_path) as file:
with open(file_path, encoding="utf-8") as file:
code = file.read()
tree = ast.parse(code)