Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.62k stars 151 forks source link

statvfs is not available on windows #171

Closed silentiumsi closed 11 months ago

silentiumsi commented 11 months ago

statvfs was introduced in the following commit: https://github.com/Tinche/aiofiles/commit/ec8cc1e27b2ecd6346b24753a1b66fd60f6b7acc

statvfs is not available on Windows as far as I can gather.

AttributeError: module 'os' has no attribute 'statvfs'

A simple fix may be something like:

if hasattr(os, 'statvfs'):
    statvfs = wrap(os.statvfs)
Tinche commented 11 months ago

Bleh, you're right. I will hotfix this, guess I need to figure out how to test on Windows too.

Tinche commented 11 months ago

I've just published 23.2.1, let me know!

silentiumsi commented 11 months ago

I've just published 23.2.1, let me know!

This looks to be fixed on Windows 11. At least in the context of https://github.com/AUTOMATIC1111/stable-diffusion-webui

Thanks for handling it so quickly :)