Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
kozlovsky committed Sep 9, 2022
1 parent 6b384ce commit 4e3cae5
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/tribler/gui/tribler_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,13 +681,7 @@ def on_add_button_pressed(channel_id):
if scheme == FILE_SCHEME:
file_path = url_to_path(uri)
content = Path(file_path).read_bytes()
try:
post_data['torrent'] = b64encode(content).decode('utf8')
except UnicodeDecodeError as e:
self._logger.error(f'{e.__class__.__name__}: {e}')
error_message = f'Can not add the torrent to the personal channel: {e}'
ConfirmationDialog.show_message(self.window(), tr('Error'), tr(error_message), "OK")

post_data['torrent'] = b64encode(content).decode('ascii')
elif scheme == MAGNET_SCHEME:
post_data['uri'] = uri

Expand Down

0 comments on commit 4e3cae5

Please sign in to comment.