aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorSergey M <dstftw@gmail.com>2016-01-14 22:20:02 +0500
committerSergey M <dstftw@gmail.com>2016-01-14 22:20:02 +0500
commit345f12196c9ed37094aec8c029809be888052d3a (patch)
treeb78d826ad0dc32c70fa4a4354b7db5b420eb9dbc /test
parent5769b68bc018654b959580624b545a9e7e857c5b (diff)
parent30e2f2d76f6dd52803effce14fa14f3a8051c84a (diff)
Merge pull request #8228 from jaimeMF/disable-file-handler
[YoutubeDL] urlopen: disable the 'file:' protocol (#8227)
Diffstat (limited to 'test')
-rw-r--r--test/test_YoutubeDL.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py
index 0388c0bf3..0caa43843 100644
--- a/test/test_YoutubeDL.py
+++ b/test/test_YoutubeDL.py
@@ -12,7 +12,7 @@ import copy
from test.helper import FakeYDL, assertRegexpMatches
from youtube_dl import YoutubeDL
-from youtube_dl.compat import compat_str
+from youtube_dl.compat import compat_str, compat_urllib_error
from youtube_dl.extractor import YoutubeIE
from youtube_dl.postprocessor.common import PostProcessor
from youtube_dl.utils import ExtractorError, match_filter_func
@@ -631,6 +631,11 @@ class TestYoutubeDL(unittest.TestCase):
result = get_ids({'playlist_items': '10'})
self.assertEqual(result, [])
+ def test_urlopen_no_file_protocol(self):
+ # see https://github.com/rg3/youtube-dl/issues/8227
+ ydl = YDL()
+ self.assertRaises(compat_urllib_error.URLError, ydl.urlopen, 'file:///etc/passwd')
+
if __name__ == '__main__':
unittest.main()