diff options
author | dirkf <fieldhouse@gmx.net> | 2023-07-25 00:17:15 +0100 |
---|---|---|
committer | dirkf <fieldhouse@gmx.net> | 2023-07-25 13:19:43 +0100 |
commit | a25e9f3c84a34d43f78a4e5a6f6c2e98e2a0ade3 (patch) | |
tree | 869bde60dab873963705baae5b879b94a4b9c3a9 /test/test_YoutubeDL.py | |
parent | aac33155e40af3da96a2467dd05faea201815989 (diff) |
[compat] Use `compat_open()`
Diffstat (limited to 'test/test_YoutubeDL.py')
-rw-r--r-- | test/test_YoutubeDL.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/test_YoutubeDL.py b/test/test_YoutubeDL.py index 6cf555827..d994682b2 100644 --- a/test/test_YoutubeDL.py +++ b/test/test_YoutubeDL.py @@ -22,6 +22,7 @@ from youtube_dl.compat import ( compat_http_cookiejar_Cookie, compat_http_cookies_SimpleCookie, compat_kwargs, + compat_open as open, compat_str, compat_urllib_error, ) @@ -701,12 +702,12 @@ class TestYoutubeDL(unittest.TestCase): class SimplePP(PostProcessor): def run(self, info): - with open(audiofile, 'wt') as f: + with open(audiofile, 'w') as f: f.write('EXAMPLE') return [info['filepath']], info def run_pp(params, PP): - with open(filename, 'wt') as f: + with open(filename, 'w') as f: f.write('EXAMPLE') ydl = YoutubeDL(params) ydl.add_post_processor(PP()) @@ -725,7 +726,7 @@ class TestYoutubeDL(unittest.TestCase): class ModifierPP(PostProcessor): def run(self, info): - with open(info['filepath'], 'wt') as f: + with open(info['filepath'], 'w') as f: f.write('MODIFIED') return [], info |