diff options
| author | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-21 14:09:28 +0100 | 
|---|---|---|
| committer | Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@gmail.com> | 2013-11-21 14:09:28 +0100 | 
| commit | a6a173c2fddf2fa38a69ca750431b7ca6932bcb0 (patch) | |
| tree | 7d0aa6b243422b9d1400e8d07416aa51cb1abe0a /test/test_utils.py | |
| parent | 2bb683c2012ad45b0e3008664be5994aa603c196 (diff) | |
utils.shell_quote: Convert the args to unicode strings
The youtube test video failed with `UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 34: ordinal not in range(128)`, the problem was with the filenames being encoded.
Diffstat (limited to 'test/test_utils.py')
| -rw-r--r-- | test/test_utils.py | 6 | 
1 files changed, 6 insertions, 0 deletions
| diff --git a/test/test_utils.py b/test/test_utils.py index f3fbff042..e9e590e74 100644 --- a/test/test_utils.py +++ b/test/test_utils.py @@ -24,6 +24,8 @@ from youtube_dl.utils import (      xpath_with_ns,      smuggle_url,      unsmuggle_url, +    shell_quote, +    encodeFilename,  )  if sys.version_info < (3, 0): @@ -170,6 +172,10 @@ class TestUtil(unittest.TestCase):          self.assertEqual(res_url, url)          self.assertEqual(res_data, None) +    def test_shell_quote(self): +        args = ['ffmpeg', '-i', encodeFilename(u'ñ€ß\'.mp4')] +        self.assertEqual(shell_quote(args), u"""ffmpeg -i 'ñ€ß'"'"'.mp4'""") +  if __name__ == '__main__':      unittest.main() | 
