HyREPL icon indicating copy to clipboard operation
HyREPL copied to clipboard

hy.lex.exceptions.LexException: Ran into a RPAREN where it wasn't expected.

Open PlumpMath opened this issue 6 years ago • 4 comments

Traceback (most recent call last): File "python3.7-hy-0.17.0/bin/.hy-wrapped", line 11, in sys.exit(hy_main()) File "python3-3.7.5-env/lib/python3.7/site-packages/hy/cmdline.py", line 590, in hy_main sys.exit(cmdline_handler("hy", sys.argv)) File "python3-3.7.5-env/lib/python3.7/site-packages/hy/cmdline.py", line 546, in cmdline_handler runpy.run_module(options.mod, run_name='main', alter_sys=True) File "python3-3.7.5/lib/python3.7/runpy.py", line 205, in run_module return _run_module_code(code, init_globals, run_name, mod_spec) File "python3-3.7.5/lib/python3.7/runpy.py", line 96, in _run_module_code mod_name, mod_spec, pkg_name, script_name) File "python3-3.7.5/lib/python3.7/runpy.py", line 85, in _run_code exec(code, run_globals) File "python3-3.7.5-env/lib/python3.7/site-packages/HyREPL/server.hy", line 7, in (import [HyREPL [bencode session]]) File "", line 983, in _find_and_load File "", line 967, in _find_and_load_unlocked File "", line 677, in _load_unlocked File "", line 724, in exec_module File "", line 860, in get_code File "python3-3.7.5-env/lib/python3.7/site-packages/hy/importer.py", line 154, in _hy_source_to_code hy_tree = hy_parse(source, filename=path) File "python3-3.7.5-env/lib/python3.7/site-packages/hy/lex/init.py", line 39, in hy_parse filename=filename)) File "python3-3.7.5-env/lib/python3.7/site-packages/hy/lex/init.py", line 74, in tokenize raise e File "python3-3.7.5-env/lib/python3.7/site-packages/hy/lex/init.py", line 66, in tokenize state=ParserState(source, filename)) File "python3-3.7.5-env/lib/python3.7/site-packages/rply/parser.py", line 62, in parse self.error_handler(state, lookahead) File "python3-3.7.5-env/lib/python3.7/site-packages/hy/lex/parser.py", line 299, in error_handler token) File "python3-3.7.5-env/lib/python3.7/site-packages/HyREPL/bencode.hy", line 78 #b(.format "{}:{}" (len #bthing) thing)) ^ hy.lex.exceptions.LexException: Ran into a RPAREN where it wasn't expected.

PlumpMath avatar Nov 20 '19 23:11 PlumpMath

I get the same error. Installing from git, I get instead

$ hyrepl
Traceback (most recent call last):
  File "/home/asharma/trading/hy/backtest/bin/hy", line 12, in <module>
    sys.exit(hy_main())
  File "/home/asharma/trading/hy/backtest/lib/python3.9/site-packages/hy/cmdline.py", line 662, in hy_main
    sys.exit(cmdline_handler("hy", sys.argv))
  File "/home/asharma/trading/hy/backtest/lib/python3.9/site-packages/hy/cmdline.py", line 616, in cmdline_handler
    runpy.run_module(options['mod'], run_name='__main__', alter_sys=True)
  File "/usr/lib/python3.9/runpy.py", line 210, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/usr/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/usr/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/asharma/trading/hy/backtest/lib/python3.9/site-packages/HyREPL/server.hy", line 10, in <module>
    (import [HyREPL.middleware [test eval complete info]])
ModuleNotFoundError: No module named 'HyREPL.middleware'

atisharma avatar Oct 28 '20 19:10 atisharma

Same. In Hy 0.20.0 + Python 3.9.2 + HyREPL from pip:

$ hyrpel
Traceback (most recent call last):
  File "/home/eggplants/.pyenv/versions/3.9.2/bin/hy", line 8, in <module>
    sys.exit(hy_main())
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/cmdline.py", line 662, in hy_main
    sys.exit(cmdline_handler("hy", sys.argv))
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/cmdline.py", line 616, in cmdline_handler
    runpy.run_module(options['mod'], run_name='__main__', alter_sys=True)
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/runpy.py", line 210, in run_module
    return _run_module_code(code, init_globals, run_name, mod_spec)
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/runpy.py", line 97, in _run_module_code
    _run_code(code, mod_globals, init_globals,
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/runpy.py", line 87, in _run_code
    exec(code, run_globals)
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/HyREPL/server.hy", line 7, in <module>
    (import [HyREPL [bencode session]])
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 786, in exec_module
  File "<frozen importlib._bootstrap_external>", line 923, in get_code
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/importer.py", line 126, in _hy_source_to_code
    hy_tree = hy_parse(source, filename=path)
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/lex/__init__.py", line 38, in hy_parse
    tokenize(_source + "\n",
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/lex/__init__.py", line 74, in tokenize
    raise e
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/lex/__init__.py", line 65, in tokenize
    return parser.parse(lexer.lex(source),
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/rply/parser.py", line 62, in parse
    self.error_handler(state, lookahead)
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/hy/lex/parser.py", line 302, in error_handler
    raise LexException.from_lexer(
  File "/home/eggplants/.pyenv/versions/3.9.2/lib/python3.9/site-packages/HyREPL/bencode.hy", line 78
    #b(.format "{}:{}" (len #bthing) thing))
                                   ^
hy.lex.exceptions.LexException: Ran into a RPAREN where it wasn't expected.

eggplants avatar May 30 '21 14:05 eggplants

Same issue, tried to use it with emacs, python3.9, hy 0.20.0

pkulev avatar Oct 16 '21 19:10 pkulev

Same issue.

glyh avatar Jan 06 '22 03:01 glyh