Skip to content
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

ValueError after single backslash #1188

Closed
sanjaykenn opened this issue Apr 22, 2021 · 3 comments · Fixed by #1220
Closed

ValueError after single backslash #1188

sanjaykenn opened this issue Apr 22, 2021 · 3 comments · Fixed by #1220

Comments

@sanjaykenn
Copy link

The output of thefuck --version (something like The Fuck 3.1 using Python 3.5.0 and Bash 4.4.12(1)-release):

The Fuck 3.30 using Python 3.9.2 and Bash 5.1.4(1)-release

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

ArchLinux

How to reproduce the bug:

echo \
>
fuck

The output of The Fuck with THEFUCK_DEBUG=true exported (typically execute export THEFUCK_DEBUG=true in your shell before The Fuck):

Traceback (most recent call last):
  File "/usr/bin/thefuck", line 13, in <module>
    sys.exit(main())
  File "/usr/lib/python3.9/site-packages/thefuck/entrypoints/main.py", line 31, in main
    fix_command(known_args)
  File "/usr/lib/python3.9/site-packages/thefuck/entrypoints/fix_command.py", line 36, in fix_command
    command = types.Command.from_raw_script(raw_command)
  File "/usr/lib/python3.9/site-packages/thefuck/types.py", line 82, in from_raw_script
    output = get_output(script, expanded)
  File "/usr/lib/python3.9/site-packages/thefuck/output_readers/__init__.py", line 20, in get_output
    return rerun.get_output(script, expanded)
  File "/usr/lib/python3.9/site-packages/thefuck/output_readers/rerun.py", line 56, in get_output
    split_expand = shlex.split(expanded)
  File "/usr/lib/python3.9/shlex.py", line 315, in split
    return list(lex)
  File "/usr/lib/python3.9/shlex.py", line 300, in __next__
    token = self.get_token()
  File "/usr/lib/python3.9/shlex.py", line 109, in get_token
    raw = self.read_token()
  File "/usr/lib/python3.9/shlex.py", line 210, in read_token
    raise ValueError("No escaped character")
ValueError: No escaped character
@KamilKrr
Copy link

Yep, can confirm this issue also exists on windows/powershell

@justisGipson
Copy link

FWIW I do not get this error on mac(big sur 11.3)

@scorphus
Copy link
Collaborator

Thanks for reporting, @AlfiiSawSanta. Fix is on its way.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants