From 33290216df16ea342f330e6669975d9a79bb7f7a 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: Thu, 17 Mar 2016 19:28:52 +0300 Subject: [PATCH] bug fix --- src/callbacks.py | 2 +- src/file_transfers.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/callbacks.py b/src/callbacks.py index c1ca6e4..683f73d 100644 --- a/src/callbacks.py +++ b/src/callbacks.py @@ -137,7 +137,7 @@ def tox_file_recv(window, tray): settings = Settings.get_instance() if file_type == TOX_FILE_KIND['DATA']: print 'file' - file_name = file_name[:file_name_size].decode('utf8') + file_name = file_name[:file_name_size] invoke_in_main_thread(profile.incoming_file_transfer, friend_number, file_number, diff --git a/src/file_transfers.py b/src/file_transfers.py index 7352140..92a9657 100644 --- a/src/file_transfers.py +++ b/src/file_transfers.py @@ -33,6 +33,7 @@ class ReceiveTransfer(FileTransfer): def __init__(self, path, tox, friend_number): super(self.__class__, self).__init__(path, tox, friend_number) self._file = open(self._path, 'wb') + self._file.truncate(0) def write_chunk(self, position, data): if data is not None: