import asyncio
from aiofiles.tempfile import SpooledTemporaryFile
async def main():
async with SpooledTemporaryFile(mode='r') as f:
print(await f.newlines())
asyncio.run(main())
this code failed with
Traceback (most recent call last):
File "temp.py", line 8, in <module>
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 44, in run
return loop.run_until_complete(main)
File "/usr/lib/python3.8/asyncio/base_events.py", line 616, in run_until_complete
return future.result()
File "temp.py", line 6, in main
print(await f.newlines())
File "/home/cake/project/typing-test/.venv/lib/python3.8/site-packages/aiofiles/threadpool/utils.py", line 72, in method
return getattr(self._file, attr_name)(*args, **kwargs)
TypeError: 'NoneType' object is not callable
newlines of _io.TextIOWrapper is property, not method
this code failed with
newlines
of_io.TextIOWrapper
is property, not methodhttps://github.com/Tinche/aiofiles/blob/d010ff4d789598213334a32ec3d3f55caaab766c/src/aiofiles/tempfile/temptypes.py#L21
I think we should move
newlines
toproxy_property_directly
.