python 2.7.10
windows powershell
when I type:
> git comit -am 'test'
> fuck
it gives me something that is completely weird:
C:\Python27\lib\site-packages\win_unicode_console\__init__.py:27: RuntimeWarning: sys.stdin.encoding == 'utf-8', whereas sys.stdout.encoding == None, readline hook consumer may assume they are the same
readline_hook.enable(use_pyreadline=use_pyreadline)
[1mgit commit -am 'test'[0m [[32menter[0m/[34m↑[0m/[34m↓[0m/[31mctrl+c[0m]
and then give an exception:
Traceback (most recent call last):
File "C:\Python27\lib\runpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:\Python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\thefuck.exe\__main__.py", line 9, in <module>
File "C:\Python27\lib\site-packages\thefuck\main.py", line 80, in main
fix_command()
File "C:\Python27\lib\site-packages\thefuck\main.py", line 32, in fix_command
selected_command = select_command(corrected_commands)
File "C:\Python27\lib\site-packages\thefuck\ui.py", line 80, in select_command
for action in read_actions():
File "C:\Python27\lib\site-packages\thefuck\ui.py", line 13, in read_actions
key = get_key()
File "C:\Python27\lib\site-packages\thefuck\system\win32.py", line 25, in get_key
return ch.decode(sys.stdout.encoding)
TypeError: decode() argument 1 must be string, not None
I think this is related to UTF-8 encoding in python2...
I cannot add python3 to path, because my vim plugins will require python2 in the path...
Is there any way I can fix this?
Yes, there is. I'll send a fix very soon. Thank you for reporting this
issue.
Em 21/03/2016 20:29, "Cheng Zhang" [email protected] escreveu:
python 2.7.10
windows powershellwhen I type:
git comit -am 'test'> fuck
it gives me something that is completely weird:
C:Python27libsite-packageswin_unicode_console__init__.py:27: RuntimeWarning: sys.stdin.encoding == 'utf-8', whereas sys.stdout.encoding == None, readline hook consumer may assume they are the same
readline_hook.enable(use_pyreadline=use_pyreadline)
�[1mgit commit -am 'test'�[0m [�[32menter�[0m/�[34m↑�[0m/�[34m↓�[0m/�[31mctrl+c�[0m]and then give an exception:
Traceback (most recent call last):
File "C:Python27librunpy.py", line 162, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "C:Python27librunpy.py", line 72, in _run_code
exec code in run_globals
File "C:Python27Scriptsthefuck.exe__main__.py", line 9, in
File "C:Python27libsite-packagesthefuckmain.py", line 80, in main
fix_command()
File "C:Python27libsite-packagesthefuckmain.py", line 32, in fix_command
selected_command = select_command(corrected_commands)
File "C:Python27libsite-packagesthefuckui.py", line 80, in select_command
for action in read_actions():
File "C:Python27libsite-packagesthefuckui.py", line 13, in read_actions
key = get_key()
File "C:Python27libsite-packagesthefucksystemwin32.py", line 25, in get_key
return ch.decode(sys.stdout.encoding)
TypeError: decode() argument 1 must be string, not NoneI think this is related to UTF-8 encoding in python2...
I cannot add python3 to path, because my vim plugins will require python2
in the path...Is there any way I can fix this?
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub
https://github.com/nvbn/thefuck/issues/486
Sorry for the delay.
Thanks hope this is pushed to pip as soon as possible.
@chantisnake: No problem :smiley: In the meantime you can update to master with pip install -U git+https://github.com/nvbn/thefuck.git.
@chantisnake already in pip =)
Thanks, I just got the fix, it is awesome, but there is still decoding error like
�[1mgit commit -am 'test'�[0m [�[32menter�[0m/�[34m↑�[0m/�[34m↓�[0m/�[31mctrl+c�[0m]
this... Is there a way to fix this?
I can hunt this one at some easy pace. Subshell execution for variable definition is probably messing color sequences.
In the meantime I've already setup a Windows build on AppVeyor and things are looking good.
BTW, @nvbn, what do you think of these fancy badges?

@scorphus it woild be nice to have them.
I have problem like this. How fix it?
konstantin@pc-kondratov MSYS /c/Users/konstantin
$ fuck
Traceback (most recent call last):
File "c:\python27\lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "c:\python27\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Python27\Scripts\thefuck.exe\__main__.py", line 9, in <module>
File "c:\python27\lib\site-packages\thefuck\main.py", line 82, in main
fix_command()
File "c:\python27\lib\site-packages\thefuck\main.py", line 26, in fix_command
command = types.Command.from_raw_script(sys.argv[1:])
File "c:\python27\lib\site-packages\thefuck\types.py", line 124, in from_raw_script
stderr = result.stderr.read().decode('utf-8')
File "c:\python27\lib\encodings\utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xad in position 6: invalid start byte
Most helpful comment
Thanks, I just got the fix, it is awesome, but there is still decoding error like
this... Is there a way to fix this?