Browse Source

downloaders.py: Properly decode exception message before passing it to the log

Fixes: b2fcc5e546
Related to: #244
doc-issue-template
MrS0m30n3 7 years ago
parent
commit
d5ae3c16d3
1 changed files with 5 additions and 2 deletions
  1. 7
      youtube_dl_gui/downloaders.py

7
youtube_dl_gui/downloaders.py

@ -328,6 +328,9 @@ class YoutubeDLDownloader(object):
"""
info = preexec = None
# Keep a unicode copy of cmd for the log
ucmd = cmd
if os.name == 'nt':
# Hide subprocess window
info = subprocess.STARTUPINFO()
@ -349,8 +352,8 @@ class YoutubeDLDownloader(object):
preexec_fn=preexec,
startupinfo=info)
except (ValueError, OSError) as error:
self._log('Failed to start process: {}'.format(cmd))
self._log(unicode(error))
self._log('Failed to start process: {}'.format(ucmd))
self._log(str(error).decode(self._encoding, 'ignore'))
def extract_data(stdout):

Loading…
Cancel
Save