]> gitweb @ CieloNegro.org - youtube-dl.git/blobdiff - youtube_dl/YoutubeDL.py
Fix subtitle download error reporting (Fixes #2724)
[youtube-dl.git] / youtube_dl / YoutubeDL.py
old mode 100644 (file)
new mode 100755 (executable)
index d011dde..d4dd05d
@@ -287,7 +287,7 @@ class YoutubeDL(object):
         return self.to_stdout(message, skip_eol, check_quiet=True)
 
     def _write_string(self, s, out=None):
-        write_string(s, out=out, encoding=self.get_encoding())
+        write_string(s, out=out, encoding=self.params.get('encoding'))
 
     def to_stdout(self, message, skip_eol=False, check_quiet=False):
         """Print message to stdout if not in quiet mode."""
@@ -936,7 +936,7 @@ class YoutubeDL(object):
                         with io.open(encodeFilename(sub_filename), 'w', encoding='utf-8') as subfile:
                                 subfile.write(sub)
                 except (OSError, IOError):
-                    self.report_error('Cannot write subtitles file ' + descfn)
+                    self.report_error('Cannot write subtitles file ' + sub_filename)
                     return
 
         if self.params.get('writeinfojson', False):