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

IndexError: string index out of range in fallback plugin #11862

Closed
Alknoy opened this issue Mar 19, 2020 · 1 comment
Closed

IndexError: string index out of range in fallback plugin #11862

Alknoy opened this issue Mar 19, 2020 · 1 comment

Comments

@Alknoy
Copy link

Alknoy commented Mar 19, 2020

Description

What steps will reproduce the problem?

When I type in another say_hello to call a the function in the last line of the code listed below, this error comes up.

File "C:\Users\Al\Anaconda3\lib\site-packages\spyder\plugins\completion\fallback\actor.py", line 62, in tokenize
valid = is_prefix_valid(text, offset, language)
File "C:\Users\Al\Anaconda3\lib\site-packages\spyder\plugins\completion\fallback\utils.py", line 122, in is_prefix_valid
current_pos_text = text[offset - 1]
IndexError: string index out of range

def say_hello(name = 'Al', emoji = '😒'):
    print(f'helllloooo {name} {emoji}')
say_hello(name = 'Linda')
say_hello(emoji = ';>|')
say_hello()
say_   

Traceback

  File "C:\Users\Al\Anaconda3\lib\site-packages\spyder\plugins\completion\fallback\actor.py", line 155, in handle_msg
    msg['current_word'])
  File "C:\Users\Al\Anaconda3\lib\site-packages\spyder\plugins\completion\fallback\actor.py", line 62, in tokenize
    valid = is_prefix_valid(text, offset, language)
  File "C:\Users\Al\Anaconda3\lib\site-packages\spyder\plugins\completion\fallback\utils.py", line 122, in is_prefix_valid
    current_pos_text = text[offset - 1]
IndexError: string index out of range

Versions

  • Spyder version: 4.1.0
  • Python version: 3.7.6
  • Qt version: 5.9.6
  • PyQt5 version: 5.9.2
  • Operating System: Windows 10

Dependencies


# Mandatory:
atomicwrites >=1.2.0           :  1.3.0 (OK)
chardet >=2.0.0                :  3.0.4 (OK)
cloudpickle >=0.5.0            :  1.3.0 (OK)
diff_match_patch >=20181111    :  20181111 (OK)
intervaltree                   :  None (OK)
IPython >=4.0                  :  7.13.0 (OK)
jedi =0.14.1                   :  0.14.1 (OK)
nbconvert >=4.0                :  5.6.1 (OK)
numpydoc >=0.6.0               :  0.9.2 (OK)
paramiko >=2.4.0               :  2.7.1 (OK)
parso =0.5.2                   :  0.5.2 (OK)
pexpect >=4.4.0                :  4.8.0 (OK)
pickleshare >=0.4              :  0.7.5 (OK)
psutil >=5.3                   :  5.7.0 (OK)
pygments >=2.0                 :  2.6.1 (OK)
pylint >=0.25                  :  2.4.3 (OK)
pyls >=0.31.2;<0.32.0          :  0.31.8 (OK)
qdarkstyle >=2.8               :  2.8 (OK)
qtawesome >=0.5.7              :  0.7.0 (OK)
qtconsole >=4.6.0              :  4.7.1 (OK)
qtpy >=1.5.0                   :  1.9.0 (OK)
rtree >=0.8.3                  :  0.9.3 (OK)
sphinx >=0.6.6                 :  2.4.0 (OK)
spyder_kernels >=1.9.0;<1.10.0 :  1.9.0 (OK)
watchdog                       :  None (OK)
zmq >=17                       :  18.1.1 (OK)

# Optional:
cython >=0.21                  :  0.29.15 (OK)
matplotlib >=2.0.0             :  3.1.3 (OK)
numpy >=1.7                    :  1.18.1 (OK)
pandas >=0.13.1                :  1.0.2 (OK)
scipy >=0.17.0                 :  1.4.1 (OK)
sympy >=0.7.3                  :  1.5.1 (OK)
@ccordoba12 ccordoba12 changed the title Adding a fourth function call causes an error report, but everything runs okay/ IndexError: string index out of range in fallback plugin Mar 19, 2020
@ccordoba12 ccordoba12 added this to the Sprint 03 - II milestone Mar 25, 2020
@ccordoba12 ccordoba12 self-assigned this Mar 25, 2020
@ccordoba12
Copy link
Member

I already have a fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
v4.1.2
Release
Development

No branches or pull requests

2 participants