Skip to content

Commit

Permalink
Handle httpx.InvalidURL when setting non-URL article strings (#7319)
Browse files Browse the repository at this point in the history
* Handle httpx.InvalidURL for non-URL article strings

* add changeset

---------

Co-authored-by: gradio-pr-bot <gradio-pr-bot@users.noreply.github.com>
  • Loading branch information
2 people authored and freddyaboulton committed Feb 9, 2024
1 parent 124acf8 commit 5405048
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/red-turkeys-make.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"gradio": minor
---

feat:Handle httpx.InvalidURL when setting non-URL article strings
2 changes: 1 addition & 1 deletion gradio/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ def readme_to_html(article: str) -> str:
response = httpx.get(article, timeout=3)
if response.status_code == httpx.codes.OK: # pylint: disable=no-member
article = response.text
except httpx.RequestError:
except (httpx.InvalidURL, httpx.RequestError):
pass
return article

Expand Down

0 comments on commit 5405048

Please sign in to comment.