Use self._loop instead of self._transport._loop, because transport._loop is set to None at process exit.
Attach a file by drag & drop or click to upload