From c6c733d4a31eb4ee6324d64215a4492ab88dd75f Mon Sep 17 00:00:00 2001 From: John Hawkinson Date: Sat, 8 Oct 2016 09:27:24 -0400 Subject: [PATCH] Print traceback when raising UnavailableVideoError An OSError or IOError generally indicates something a little more wrong than a "simple" UnavailableVideoError, so print the actual traceback that leads to the exception. Otherwise meaningful postmortem debugging a bug report is essentially infeasible. --- youtube_dl/YoutubeDL.py | 1 + 1 file changed, 1 insertion(+) diff --git a/youtube_dl/YoutubeDL.py b/youtube_dl/YoutubeDL.py index 99825e343..166fe8b15 100755 --- a/youtube_dl/YoutubeDL.py +++ b/youtube_dl/YoutubeDL.py @@ -1701,6 +1701,7 @@ class YoutubeDL(object): self.report_error('unable to download video data: %s' % error_to_compat_str(err)) return except (OSError, IOError) as err: + traceback.print_exc() raise UnavailableVideoError(err) except (ContentTooShortError, ) as err: self.report_error('content too short (expected %s bytes and served %s)' % (err.expected, err.downloaded))