nvbn / thefuck

Magnificent app which corrects your previous console command.
MIT License
83.76k stars 3.41k forks source link

Python Unicode Warning (but on Git Bash) #1368

Closed LuizLoyola closed 1 year ago

LuizLoyola commented 1 year ago

The output of thefuck --version:

The Fuck 3.32 using Python 3.11.1 and Bash

Your system (Debian 7, ArchLinux, Windows, etc.):

Windows

How to reproduce the bug:

Put the eval stuff on the .bashrc and run a new terminal

The warning:

C:\Program Files\Python311\Lib\site-packages\win_unicode_console__init__.py:31: RuntimeWarning: sys.stdin.encoding == 'utf-8', whereas sys.stdout.encoding == 'cp1252', readline hook consumer may assume they are the same readline_hook.enable(use_pyreadline=use_pyreadline)

I've read about this exact error and how to solve it for PowerShell, but how can I solve it for Git Bash?

LuizLoyola commented 1 year ago

Literally 1 minute after the post I used my brain to figure out that you can just use practically the same solution for PowerShell, but as an export:

Add export PYTHONIOENCODING="utf-8" to your .bashrc before the eval