Sometimes, in my repl, stackprinter doesn't work. I found the issue though: in the file /usr/local/lib/python3.8/dist-packages/stackprinter/source_inspection.py, on line 64, sometimes max_line_relative is a float; and this error goes away when you make it an int.
In other words (talking to the author here), in /usr/local/lib/python3.8/dist-packages/stackprinter/source_inspection.py, could you please change line 64 from:
Stackprinter failed:
File "/usr/local/lib/python3.8/dist-packages/stackprinter/source_inspection.py", line 65, in annotate
tokens, head_s, head_e = _tokenize(source_lines[:max_line_relative])
TypeError: slice indices must be integers or None or have an index method
So here is your original traceback at least:
Traceback (most recent call last):
File "", line 1, in
vim(get_module_path('rp.help'))
File "/home/ryan/.local/lib/python3.8/site-packages/rp/r.py", line 13146, in get_module_path
return get_module_path_from_name(module)
File "/home/ryan/.local/lib/python3.8/site-packages/rp/r.py", line 13141, in get_module_path_from_name
return importlib.util.find_spec(module_name).origin
AttributeError: 'NoneType' object has no attribute 'origin'
Sometimes, in my repl, stackprinter doesn't work. I found the issue though: in the file /usr/local/lib/python3.8/dist-packages/stackprinter/source_inspection.py, on line 64, sometimes max_line_relative is a float; and this error goes away when you make it an int.
In other words (talking to the author here), in /usr/local/lib/python3.8/dist-packages/stackprinter/source_inspection.py, could you please change line 64 from:
to
Thank you!
-Ryan
Btw, here's the error I get:
Stackprinter failed: File "/usr/local/lib/python3.8/dist-packages/stackprinter/source_inspection.py", line 65, in annotate tokens, head_s, head_e = _tokenize(source_lines[:max_line_relative]) TypeError: slice indices must be integers or None or have an index method
So here is your original traceback at least:
Traceback (most recent call last): File "", line 1, in
vim(get_module_path('rp.help'))
File "/home/ryan/.local/lib/python3.8/site-packages/rp/r.py", line 13146, in get_module_path
return get_module_path_from_name(module)
File "/home/ryan/.local/lib/python3.8/site-packages/rp/r.py", line 13141, in get_module_path_from_name
return importlib.util.find_spec(module_name).origin
AttributeError: 'NoneType' object has no attribute 'origin'