Skip to content

[Bug] TheFuck crashes when used #783

@LunarWatcher

Description

@LunarWatcher

The output of thefuck --version :

The Fuck 3.25 using Python 3.6.4

Shell:

Git Bash -> git version 2.15.1.windows.2

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

Windows 10

How to reproduce the bug:

pip install thefuck

configure .bashrc with eval $(thefuck --alias)

Test it:

$ hlp
bash: hlp: command not found 
$ fuck
[stacktrace]

With THEFUCK_DEBUG set to true, the debug output and stacktrace:

DEBUG: Run with settings: {'alter_history': True,
 'debug': True,
 'env': {'GIT_TRACE': '1', 'LANG': 'C', 'LC_ALL': 'C'},
 'exclude_rules': [],
 'history_limit': None,
 'instant_mode': False,
 'no_colors': False,
 'priority': {},
 'repeat': False,
 'require_confirmation': True,
 'rules': [<const: All rules enabled>],
 'slow_commands': ['lein', 'react-native', 'gradle', './gradlew', 'vagrant'],
 'user_dir': WindowsPath('C:/Users/LunarWatcher/.config/thefuck'),
 'wait_command': 3,
 'wait_slow_command': 15}
DEBUG: Received output: 'hlp' is not recognized as an internal or external command,
operable program or batch file.

DEBUG: Total took: 0:00:00.031233
Traceback (most recent call last):
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "C:\Users\LunarWatcher\AppData\Local\Programs\Python\Python36\Scripts\thefuck.exe\__main__.py", line 9, in <module>
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\site-packages\thefuck\entrypoints\main.py", line 25, in main
    fix_command(known_args)
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\site-packages\thefuck\entrypoints\fix_command.py", line 41, in fix_command
    corrected_commands = get_corrected_commands(command)
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\site-packages\thefuck\corrector.py", line 89, in get_corrected_commands
    corrected for rule in get_rules()
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\site-packages\thefuck\corrector.py", line 46, in get_rules
    paths = [rule_path for path in get_rules_import_paths()
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\site-packages\thefuck\corrector.py", line 46, in <listcomp>
    paths = [rule_path for path in get_rules_import_paths()
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\site-packages\thefuck\corrector.py", line 34, in get_rules_import_paths
    for contrib_module in Path(path).glob('thefuck_contrib_*'):
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\pathlib.py", line 1078, in glob
    for p in selector.select_from(self):
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\pathlib.py", line 487, in select_from
    if not is_dir(parent_path):
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\pathlib.py", line 1326, in is_dir
    return S_ISDIR(self.stat().st_mode)
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\pathlib.py", line 1136, in stat
    return self._accessor.stat(self)
  File "c:\users\lunarwatcher\appdata\local\programs\python\python36\lib\pathlib.py", line 387, in wrapped
    return strfunc(str(pathobj), *args)
OSError: [WinError 123] Filnavnet, mappenavnet eller volumnavnesyntaksen er feil: 'C:\\Program Files\\Git\\:' <---- This last part (roughly) translates to "The filename, folder name or volume label syntax is wrong:"

And this is fresh out of the box. I haven't used it before, and the crash happens right after installing. Re-installing doesn't do any good either. I can't install python-dev, because it's not available for windows. And the pre-compiled binaries as posted in one of the answers doesn't have python-dev any more.

I updated python too, to see if that made any difference, but it still crashes like that.

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions