mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 06:35:12 +00:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -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() | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Jaime Marquínez Ferrándiz
					Jaime Marquínez Ferrándiz