mirror of
				https://github.com/yt-dlp/yt-dlp.git
				synced 2025-10-31 14:45:14 +00:00 
			
		
		
		
	[utils] Fix bug in 0b9c08b47b
				
					
				
			* Cache of `supports_terminal_sequences` must be reset after enabling VT mode * and move `windows_enable_vt_mode` to utils to avoid cyclic imports
This commit is contained in:
		| @@ -33,7 +33,6 @@ from .compat import ( | ||||
|     compat_str, | ||||
|     compat_urllib_error, | ||||
|     compat_urllib_request, | ||||
|     windows_enable_vt_mode, | ||||
| ) | ||||
| from .cookies import load_cookies | ||||
| from .downloader import FFmpegFD, get_suitable_downloader, shorten_protocol_name | ||||
| @@ -142,6 +141,7 @@ from .utils import ( | ||||
|     url_basename, | ||||
|     variadic, | ||||
|     version_tuple, | ||||
|     windows_enable_vt_mode, | ||||
|     write_json_file, | ||||
|     write_string, | ||||
| ) | ||||
| @@ -3605,7 +3605,7 @@ class YoutubeDL: | ||||
|         def get_encoding(stream): | ||||
|             ret = str(getattr(stream, 'encoding', 'missing (%s)' % type(stream).__name__)) | ||||
|             if not supports_terminal_sequences(stream): | ||||
|                 from .compat import WINDOWS_VT_MODE  # Must be imported locally | ||||
|                 from .utils import WINDOWS_VT_MODE  # Must be imported locally | ||||
|                 ret += ' (No VT)' if WINDOWS_VT_MODE is False else ' (No ANSI)' | ||||
|             return ret | ||||
| 
 | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 pukkandan
					pukkandan