Max Orlov
Max Orlov
It doesn't help. It stucks somewhere inside asyncssh.scp function and don't throw Exception outside. ``` [conn=0, chan=0] Received 16384 SCP data bytes [conn=0, chan=0] Received 16384 SCP data bytes
Might be this gives you a clue: everything works fine if there is one more task running in parallel with scp process. So I found that workaround: ```python async def...
I think problem is here: ```python class _SCPSink(_SCPHandler): async def run(self, dstpath: _SCPPath) -> None: try: else: # if asyncio runner catches KeyboardInterrupted, then it will cancel all tasks, so...
Updated workaround: ```python async def download(host: str): path = Path(f"./download/{host}") path.mkdir(parents=True, exist_ok=True) try: async with asyncssh.connect(host) as conn: print(f"{host}: connected") done = asyncio.Event() async def download(): try: await asyncssh.scp((conn, HUGE_FILE),...
The only one purpose of done.wait() hack is to have a function which could catch CancelledError exception and propagate it outside to `async with asyncssh.connect(host)`. Exiting connect() context will close...
Unfortunately it didn't help: ``` [conn=0, chan=0] Received 8192 SCP data bytes [conn=0, chan=0] Received 8192 SCP data bytes [conn=0, chan=0] Received 8192 SCP data bytes
I see that process stuck here: ```python async def wait_closed(self) -> None: await self._close_event.wait() ``` Closing process wait until `_close_event `will be set, but only one place where it could...
`self._recv_state` is in 'open' during `abort()` call, so next condition will not work ```python def _discard_recv(self) -> None: if self._recv_state == 'close_pending': self._recv_state = 'closed' self._loop.call_soon(self._cleanup) ```
It works now: ``` [conn=0, chan=0] Received 16384 SCP data bytes [conn=0, chan=0] Received 16384 SCP data bytes [conn=0, chan=0] Received 16384 SCP data bytes ^C[conn=0, chan=0] Stopping remote SCP...
I've got exact the same exception in next case: file influxdb.py: ``` _client: Optional[InfluxDBClient] = None def init(url: str, org: str, token: str) -> None: global _client _client = InfluxDBClient(url=url,...