mirror of
				https://gitlab.com/ytdl-org/youtube-dl.git
				synced 2025-11-04 00:17:07 -05:00 
			
		
		
		
	use sys.stdout.buffer only on Python3
This commit is contained in:
		@@ -329,7 +329,7 @@ def sanitize_open(filename, open_mode):
 | 
			
		||||
            if sys.platform == 'win32':
 | 
			
		||||
                import msvcrt
 | 
			
		||||
                msvcrt.setmode(sys.stdout.fileno(), os.O_BINARY)
 | 
			
		||||
            return (sys.stdout.buffer, filename)
 | 
			
		||||
            return (sys.stdout.buffer if hasattr(sys.stdout, 'buffer') else sys.stdout, filename)
 | 
			
		||||
        stream = open(encodeFilename(filename), open_mode)
 | 
			
		||||
        return (stream, filename)
 | 
			
		||||
    except (IOError, OSError) as err:
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user