From 8cc54d1ec00753d5ff59c2b3e089439e2c79c82e Mon Sep 17 00:00:00 2001 From: Julien Kirch Date: Thu, 12 Dec 2024 16:28:42 +0100 Subject: [PATCH 1/6] Fix ModuleNotFoundError --- gradio/route_utils.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/gradio/route_utils.py b/gradio/route_utils.py index 4b670e8bfe7f9..59c62bcb7f2c7 100644 --- a/gradio/route_utils.py +++ b/gradio/route_utils.py @@ -31,9 +31,8 @@ import fastapi import gradio_client.utils as client_utils import httpx -import multipart from gradio_client.documentation import document -from multipart.multipart import parse_options_header +from python_multipart.multipart import parse_options_header from starlette.datastructures import FormData, Headers, MutableHeaders, UploadFile from starlette.formparsers import MultiPartException, MultipartPart from starlette.responses import PlainTextResponse, Response From a7063a67105a49ace143bb479a2ba91c6262afd9 Mon Sep 17 00:00:00 2001 From: gradio-pr-bot Date: Thu, 12 Dec 2024 15:40:07 +0000 Subject: [PATCH 2/6] add changeset --- .changeset/wild-sheep-agree.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/wild-sheep-agree.md diff --git a/.changeset/wild-sheep-agree.md b/.changeset/wild-sheep-agree.md new file mode 100644 index 0000000000000..de3ece76186f3 --- /dev/null +++ b/.changeset/wild-sheep-agree.md @@ -0,0 +1,5 @@ +--- +"gradio": minor +--- + +feat:Fix ModuleNotFoundError: No module named 'multipart.multipart'; 'multipart' is not a package From f558f4ec5d85ad3b51e9e44857751a6b5ea45016 Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Thu, 12 Dec 2024 07:42:55 -0800 Subject: [PATCH 3/6] more changes --- gradio/route_utils.py | 4 ++-- gradio/routes.py | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/gradio/route_utils.py b/gradio/route_utils.py index 59c62bcb7f2c7..989ecf3ec2f6f 100644 --- a/gradio/route_utils.py +++ b/gradio/route_utils.py @@ -32,7 +32,7 @@ import gradio_client.utils as client_utils import httpx from gradio_client.documentation import document -from python_multipart.multipart import parse_options_header +from python_multipart.multipart import MultipartParser, parse_options_header from starlette.datastructures import FormData, Headers, MutableHeaders, UploadFile from starlette.formparsers import MultiPartException, MultipartPart from starlette.responses import PlainTextResponse, Response @@ -643,7 +643,7 @@ async def parse(self) -> FormData: } # Create the parser. - parser = multipart.MultipartParser(boundary, callbacks) # type: ignore + parser = MultipartParser(boundary, callbacks) # type: ignore try: # Feed the parser with data from the request. async for chunk in self.stream: diff --git a/gradio/routes.py b/gradio/routes.py index 5a0e88b73c1fa..27da69e5c8e5b 100644 --- a/gradio/routes.py +++ b/gradio/routes.py @@ -56,7 +56,7 @@ from gradio_client.documentation import document from gradio_client.utils import ServerMessage from jinja2.exceptions import TemplateNotFound -from multipart.multipart import parse_options_header +from python_multipart.multipart import MultipartParser, parse_options_header from starlette.background import BackgroundTask from starlette.datastructures import UploadFile as StarletteUploadFile from starlette.responses import RedirectResponse From 202beb02aa1d99920f4a9f836c8223d72d69664d Mon Sep 17 00:00:00 2001 From: Abubakar Abid Date: Thu, 12 Dec 2024 07:43:15 -0800 Subject: [PATCH 4/6] formt --- gradio/routes.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gradio/routes.py b/gradio/routes.py index 27da69e5c8e5b..852dcc2de7f6a 100644 --- a/gradio/routes.py +++ b/gradio/routes.py @@ -56,7 +56,7 @@ from gradio_client.documentation import document from gradio_client.utils import ServerMessage from jinja2.exceptions import TemplateNotFound -from python_multipart.multipart import MultipartParser, parse_options_header +from python_multipart.multipart import parse_options_header from starlette.background import BackgroundTask from starlette.datastructures import UploadFile as StarletteUploadFile from starlette.responses import RedirectResponse From f416e2e577ab12592e54742ca336ce9ddf04d379 Mon Sep 17 00:00:00 2001 From: gradio-pr-bot Date: Thu, 12 Dec 2024 15:44:35 +0000 Subject: [PATCH 5/6] add changeset --- .changeset/wild-sheep-agree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wild-sheep-agree.md b/.changeset/wild-sheep-agree.md index de3ece76186f3..020dc1f10332c 100644 --- a/.changeset/wild-sheep-agree.md +++ b/.changeset/wild-sheep-agree.md @@ -1,5 +1,5 @@ --- -"gradio": minor +"gradio": patch --- feat:Fix ModuleNotFoundError: No module named 'multipart.multipart'; 'multipart' is not a package From e364074fae7fee0a4afdd6c87de272f74f1fafbd Mon Sep 17 00:00:00 2001 From: gradio-pr-bot Date: Thu, 12 Dec 2024 15:45:46 +0000 Subject: [PATCH 6/6] add changeset --- .changeset/wild-sheep-agree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/wild-sheep-agree.md b/.changeset/wild-sheep-agree.md index 020dc1f10332c..b396f11de1f1e 100644 --- a/.changeset/wild-sheep-agree.md +++ b/.changeset/wild-sheep-agree.md @@ -2,4 +2,4 @@ "gradio": patch --- -feat:Fix ModuleNotFoundError: No module named 'multipart.multipart'; 'multipart' is not a package +feat:Fix `multipart` ModuleNotFoundError by renaming import to `python_multipart`