Autojump: Problem with running autojump on Windows 10 and python 3.9

Created on 8 Feb 2021  ·  3Comments  ·  Source: wting/autojump

Traceback (most recent call last):
File "C:\Users\yixiu\AppDataLocalautojumpbinautojump", line 342, in
sys.exit(main(parse_arguments()))
File "C:\Users\yixiu\AppDataLocalautojumpbinautojump", line 332, in main
print_local(first(chain(
File "C:\Users\yixiu\AppDataLocalautojumpbinautojump_utils.py", line 41, in first
return it.__next__()
File "C:\Users\yixiu\AppDataLocalautojumpbinautojump_match.py", line 83, in
found = lambda entry: re.search(
File "E:dev\Python\lib\re.py", line 201, in search
return _compile(pattern, flags).search(string)
File "E:dev\Python\lib\re.py", line 304, in _compile
p = sre_compile.compile(pattern, flags)
File "E:dev\Python\lib\sre_compile.py", line 764, in compile
p = sre_parse.parse(p, flags)
File "E:dev\Python\lib\sre_parse.py", line 948, in parse
p = _parse_sub(source, state, flags & SRE_FLAG_VERBOSE, 0)
File "E:dev\Python\lib\sre_parse.py", line 443, in _parse_sub
itemsappend(_parse(source, state, verbose, nested + 1,
File "E:dev\Python\lib\sre_parse.py", line 549, in _parse
raise source.error("unterminated character set",
re.error: unterminated character set at position 4

Most helpful comment

re.escape(os.sep) because on windows os.sep is \ and need escape #618

All 3 comments

re.escape(os.sep) because on windows os.sep is \ and need escape #618

CMD works, but PowerShell can't find the path properly.

I followed this guide https://leetschau.github.io/autojump-in-windows-console.html and added these lines to bin/autojump_math.py:78-88:

sep = '\\\\' if os.sep == '\\' else os.sep
regex_no_sep = '[^' + sep + ']*'
regex_no_sep_end = regex_no_sep + '$'
regex_one_sep = regex_no_sep + sep + regex_no_sep

And I also had to add the /bin folder of the repo to the Environmental variables of windows. The install script didn't cut it (maybe because I was using it in PowerShell?)

I still however can't get it to work with PowerShell, but it works on command prompt 🤷

Using python version 3.9.2.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

shepherdwind picture shepherdwind  ·  11Comments

turingking picture turingking  ·  12Comments

loveencounterflow picture loveencounterflow  ·  6Comments

juanrgon picture juanrgon  ·  4Comments

hcsaustrup picture hcsaustrup  ·  9Comments