Skip to content

Pin aiofiles version? #5153

Closed
Closed
@catboxanon

Description

Describe the bug

Edit: This was fixed upstream pretty fast but I still am going to propose the question here.

This is moreso a question. A recent aiofiles update broke compatibility with Windows systems.

Tinche/aiofiles#162
Tinche/aiofiles#171
Tinche/aiofiles#172

Currently the version Gradio specifies for this is pretty lenient which allowed this to seep thru.

aiofiles>=22.0,<24.0

Should this be considered to be a more strict version pin to prevent any similar issues occurring in the future?

Have you searched existing issues? 🔎

  • I have searched and found no existing issues

Reproduction

Create a fresh Python venv and install Gradio, and run any demo from https://www.gradio.app/demos. Instead a traceback will be returned with AttributeError: module 'os' has no attribute 'statvfs'.

Screenshot

No response

Logs

Traceback (most recent call last):
  File "H:\Projects\Programming\_new\gradiotest\main.py", line 1, in <module>
    import gradio as gr
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\__init__.py", line 3, in <module>
    import gradio.components as components
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\components\__init__.py", line 1, in <module>
    from gradio.components.annotated_image import AnnotatedImage
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\components\annotated_image.py", line 13, in <module>
    from gradio.components.base import IOComponent, _Keywords
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\components\base.py", line 29, in <module>
    from gradio.blocks import Block, BlockContext
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\blocks.py", line 27, in <module>
    from gradio import (
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\networking.py", line 18, in <module>
    from gradio.routes import App
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\routes.py", line 44, in <module>
    import gradio.ranged_response as ranged_response
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\gradio\ranged_response.py", line 12, in <module>
    from aiofiles.os import stat as aio_stat
  File "H:\Projects\Programming\_new\gradiotest\venv\lib\site-packages\aiofiles\os.py", line 32, in <module>
    statvfs = wrap(os.statvfs)
AttributeError: module 'os' has no attribute 'statvfs'

System Info

# (can't even run this as the same crash occurs; running on Windows 11)

Severity

I can work around it

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions