mirror of
				https://github.com/nvbn/thefuck.git
				synced 2025-10-31 07:04:12 +00:00 
			
		
		
		
	Merge pull request #487 from scorphus/stdout-encoding-none
#486: Use alternative encoding when sys.stdout.encoding is None
This commit is contained in:
		| @@ -1,3 +1,4 @@ | |||||||
|  | import os | ||||||
| import sys | import sys | ||||||
| import msvcrt | import msvcrt | ||||||
| import win_unicode_console | import win_unicode_console | ||||||
| @@ -22,4 +23,5 @@ def get_key(): | |||||||
|     if ch == b'P': |     if ch == b'P': | ||||||
|         return const.KEY_DOWN |         return const.KEY_DOWN | ||||||
|  |  | ||||||
|     return ch.decode(sys.stdout.encoding) |     encoding = sys.stdout.encoding or os.environ.get('PYTHONIOENCODING', 'utf-8') | ||||||
|  |     return ch.decode(encoding) | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user