You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ python3 test_asyncpg_copy_to_table.py
Traceback (most recent call last):
File "test_asyncpg_copy_to_table.py", line 18, in <module>
asyncio.run(main())
File "/usr/lib/python3.8/asyncio/runners.py", line 43, 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 "test_asyncpg_copy_to_table.py", line 8, in main
await conn.copy_to_table(
File "/usr/local/lib/python3.8/dist-packages/asyncpg/connection.py", line 666, in copy_to_table
return await self._copy_in(copy_stmt, source, timeout)
File "/usr/local/lib/python3.8/dist-packages/asyncpg/connection.py", line 845, in _copy_in
return await self._protocol.copy_in(
File "asyncpg/protocol/protocol.pyx", line 482, in copy_in
File "asyncpg/protocol/protocol.pyx", line 455, in asyncpg.protocol.protocol.BaseProtocol.copy_in
File "asyncpg/protocol/protocol.pyx", line 456, in asyncpg.protocol.protocol.BaseProtocol.copy_in
File "/usr/lib/python3.8/asyncio/tasks.py", line 455, in wait_for
return await fut
File "/usr/local/lib/python3.8/dist-packages/asyncpg/connection.py", line 836, in __anext__
data = await run_in_executor(None, f.read, 524288)
File "/usr/lib/python3.8/concurrent/futures/thread.py", line 57, in run
result = self.fn(*self.args, **self.kwargs)
io.UnsupportedOperation: read
And the file "copy_test.csv" is now 0 bytes.
The text was updated successfully, but these errors were encountered:
sergeyspatar
changed the title
conn.copy_to_table() erases source file and throws exception
conn.copy_to_table() empties source file and throws exception
May 14, 2020
the issue with a local PostgreSQL install?: I use local PostgreSQL
Steps to reproduce:
conn.copy_to_table()
:Script throws exception:
And the file "copy_test.csv" is now 0 bytes.
The text was updated successfully, but these errors were encountered: