secretGeek / ok-bash

.ok folder profiles for bash
MIT License
89 stars 6 forks source link

Syntax errors in python file #16

Closed aiverson closed 4 years ago

aiverson commented 5 years ago

When invoking ok from bash, the following error message is printed and nothing else happens.

/home/aiverson/utils/ok-bash/ok-show.py:35: SyntaxWarning: invalid escape sequence \S
  comment    = re.compile('(^[ \t]+)?(?<!\S)(?=#)(?!#\{)')
/home/aiverson/utils/ok-bash/ok-show.py:36: SyntaxWarning: invalid escape sequence \[
  ansi_len   = re.compile('\x1b\[.*?m')
/home/aiverson/utils/ok-bash/ok-show.py:183: SyntaxWarning: invalid escape sequence \#
  '''

My python versions are python: 2.7.16; python3 3.8.0b2. The system is NixOS.

doekman commented 5 years ago

I suspect ok-show.py is using python3 3.8.0b2, which is still a pre-release (note: 3.8.0b3 has also been released). I will test and possibly fix the issue when 3.8 is released.

In the meantime, you can force ok-bash to use python 2, by running this command before or after ok-bash is initialized:

export _OK__PATH_TO_PYTHON=$(command -v python)
doekman commented 4 years ago

Hi @aiverson, I've just tested with Python 3.8.0 on macOS Mojave, and _okbash runs just fine. Do you still have troubles, or is your problem fixed now?