gradio-app / gradio

Build and share delightful machine learning apps, all in Python. 🌟 Star to support our work!
http://www.gradio.app
Apache License 2.0
30.69k stars 2.28k forks source link

Fix encoding error #8381

Closed xu-song closed 1 month ago

xu-song commented 1 month ago

Description

with gr.Blocks(css="css/style.css", js="js/onload.js") as demo:
    pass
  File "C:\Users\xusong\Miniconda3\envs\py3.10\lib\site-packages\gradio\blocks.py", line 791, in __init__
    self.js = js_file.read()
UnicodeDecodeError: 'gbk' codec can't decode byte 0xa4 in position 543: illegal multibyte sequence

Closes: #8076, #7856

Tests

  1. PRs will only be merged if tests pass on CI. To run the tests locally, please set up your Gradio environment locally and run the tests: bash scripts/run_all_tests.sh

  2. You may need to run the linters: bash scripts/format_backend.sh and bash scripts/format_frontend.sh

gradio-pr-bot commented 1 month ago

🪼 branch checks and previews

• Name Status URL
Spaces ready! Spaces preview
Website ready! Website preview
:unicorn: Changes detecting...

Install Gradio from this PR

pip install https://gradio-builds.s3.amazonaws.com/ac97ef9f07194218795c767f9a065d01f5abe85f/gradio-4.31.5-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@ac97ef9f07194218795c767f9a065d01f5abe85f#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-builds.s3.amazonaws.com/ac97ef9f07194218795c767f9a065d01f5abe85f/gradio-client-0.19.4.tgz
gradio-pr-bot commented 1 month ago

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
gradio patch

With the following changelog entry.

Fix encoding error

Maintainers or the PR author can modify the PR title to modify this entry.

#### Something isn't right? - Maintainers can change the version label to modify the version bump. - If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can [update the changelog file directly](https://github.com/xu-song/gradio/edit/patch-2/.changeset/common-zoos-retire.md).