From e3f89351ee2b6ce31d62be66588635c53bc9834f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=90=D0=BD=D0=B4=D1=80=D0=B5=D0=B9=20=D0=92=D0=BB=D0=B0?= =?UTF-8?q?=D0=B4=D0=B8=D0=BC=D0=B8=D1=80=D0=BE=D0=B2=D0=B8=D1=87?= Date: Wed, 23 Mar 2016 23:44:35 +0300 Subject: [PATCH] avatar reset hotfix --- src/file_transfers.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/file_transfers.py b/src/file_transfers.py index 5088fc6..6bb81fc 100644 --- a/src/file_transfers.py +++ b/src/file_transfers.py @@ -48,6 +48,7 @@ class FileTransfer(QtCore.QObject): def cancel(self): self.send_control(TOX_FILE_CONTROL['CANCEL']) if hasattr(self, '_file'): + print 'closing' self._file.close() self._state_changed.signal.emit(self.state, self._done / self._size) @@ -170,9 +171,10 @@ class ReceiveAvatar(ReceiveTransfer): super(ReceiveAvatar, self).__init__(path, tox, friend_number, size, file_number) if exists(path): if not size: - remove(path) self.send_control(TOX_FILE_CONTROL['CANCEL']) self.state = TOX_FILE_TRANSFER_STATE['CANCELED'] + self._file.close() + remove(path) else: hash = self.get_file_id() with open(path, 'rb') as fl: