-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
powershell encoding warning on every 'fuck' execution #514
Comments
I see this as well. There are two options I've come up with, but I don't fully understand the ramifications of doing so. One is: diff --git a/thefuck/system/win32.py b/thefuck/system/win32.py
index a8b6c0a..6d6fa0a 100644
--- a/thefuck/system/win32.py
+++ b/thefuck/system/win32.py
@@ -7,7 +7,7 @@ from .. import const
def init_output():
import colorama
- win_unicode_console.enable()
+ win_unicode_console.enable(use_readline_hook = False)
colorama.init() Which works on my system (Windows 10 + PowerShell), but I don't know enough about The safer but hack-ish way is to just ignore the warning diff --git a/thefuck/system/win32.py b/thefuck/system/win32.py
index a8b6c0a..a38c584 100644
--- a/thefuck/system/win32.py
+++ b/thefuck/system/win32.py
@@ -3,14 +3,15 @@ import sys
import msvcrt
import win_unicode_console
from .. import const
+import warnings
def init_output():
import colorama
- win_unicode_console.enable()
+ with warnings.catch_warnings():
+ warnings.simplefilter("ignore")
+ win_unicode_console.enable()
colorama.init() Let me know how I can help with a fix here as this is the last bug I run into using |
I fixed this by setting |
FYI, this is documented https://github.com/nvbn/thefuck/wiki/Shell-aliases#powershell so this issue can likely be closed |
@nvbn Thanks for this!
|
each time I run fuck in my powershell prompt, I get warned about mismatched stdin and stdout encodings:
c:\python34\lib\site-packages\win_unicode_console__init__.py:27: 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 saw issue #486, but this issue is slightly different (the encoding isn't 'None').
The text was updated successfully, but these errors were encountered: