commit: a383a98af617265803cbfa38f540d5f412899c3c
parent acd69589a54d03f60a018a298c74a4c8aef2abc2
Author: Philipp Hagemeister <phihag@phihag.de>
Date: Wed, 30 Apr 2014 10:07:32 +0200
[utils/_windows_write_string] Be defensive about fileno (Fixes #2820)
Diffstat:
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/youtube_dl/utils.py b/youtube_dl/utils.py
@@ -926,7 +926,11 @@ def _windows_write_string(s, out):
2: -12,
}
- fileno = out.fileno()
+ try:
+ fileno = out.fileno()
+ except AttributeError:
+ # If the output stream doesn't have a fileno, it's virtual
+ return False
if fileno not in WIN_OUTPUT_IDS:
return False