mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-11-04 08:35:12 +00:00 
			
		
		
		
	Work around a Python bug on Windows with UTF-8 configuration (#820)
This commit is contained in:
		@@ -30,6 +30,7 @@ __authors__  = (
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
__license__ = 'Public Domain'
 | 
					__license__ = 'Public Domain'
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					import codecs
 | 
				
			||||||
import getpass
 | 
					import getpass
 | 
				
			||||||
import optparse
 | 
					import optparse
 | 
				
			||||||
import os
 | 
					import os
 | 
				
			||||||
@@ -335,6 +336,11 @@ def parseOpts(overrideArguments=None):
 | 
				
			|||||||
    return parser, opts, args
 | 
					    return parser, opts, args
 | 
				
			||||||
 | 
					
 | 
				
			||||||
def _real_main(argv=None):
 | 
					def _real_main(argv=None):
 | 
				
			||||||
 | 
					    # Compatibility fixes for Windows
 | 
				
			||||||
 | 
					    if sys.platform == 'win32':
 | 
				
			||||||
 | 
					        # https://github.com/rg3/youtube-dl/issues/820
 | 
				
			||||||
 | 
					        codecs.register(lambda name: codecs.lookup('utf-8') if name == 'cp65001' else None)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    parser, opts, args = parseOpts(argv)
 | 
					    parser, opts, args = parseOpts(argv)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    # Open appropriate CookieJar
 | 
					    # Open appropriate CookieJar
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user