Tinche / aiofiles

File support for asyncio
Apache License 2.0
2.67k stars 149 forks source link

awaiting for aiofiles.os.remove() returns TypeError: object NoneType can't be used in 'await' expression #76

Closed OmerAbramovich closed 4 years ago

OmerAbramovich commented 4 years ago

I'm trying to remove a file from a local directory asynchronously; however, I get the following error: object NoneType can't be used in 'await' expression (<class 'TypeError'>) I'm using ver aiofiles 0.5.0 and Python 3.6.5

my code is as straightforward as such:

async def delete_local_file(file_to_del):
    await aiof.os.remove(file_to_del)
    print("deleted: "+file_to_del)

await delete_local_file(localfile)