mirror of
https://github.com/rembo10/headphones.git
synced 2026-07-20 07:54:01 +01:00
UnicodeDecodeError printing torrent name containing unicode
This commit is contained in:
@@ -170,7 +170,10 @@ def addTorrent(link, data=None, name=None):
|
|||||||
# remove '.torrent' suffix
|
# remove '.torrent' suffix
|
||||||
if name[-len('.torrent'):] == '.torrent':
|
if name[-len('.torrent'):] == '.torrent':
|
||||||
name = name[:-len('.torrent')]
|
name = name[:-len('.torrent')]
|
||||||
logger.debug('Deluge: Sending Deluge torrent with name %s and content [%s...]' % (name, str(torrentfile)[:40]))
|
try:
|
||||||
|
logger.debug('Deluge: Sending Deluge torrent with name %s and content [%s...]' % (name, str(torrentfile)[:40]))
|
||||||
|
except UnicodeDecodeError:
|
||||||
|
logger.debug('Deluge: Sending Deluge torrent with name %s and content [%s...]' % (name.decode('utf-8'), str(torrentfile)[:40]))
|
||||||
result = {'type': 'torrent',
|
result = {'type': 'torrent',
|
||||||
'name': name,
|
'name': name,
|
||||||
'content': torrentfile}
|
'content': torrentfile}
|
||||||
|
|||||||
Reference in New Issue
Block a user