Skip to content

bpython (master) dies on input #491

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

Closed
amorozov opened this issue Feb 24, 2015 · 2 comments
Closed

bpython (master) dies on input #491

amorozov opened this issue Feb 24, 2015 · 2 comments

Comments

@amorozov
Copy link

After upgrading to the most recent commit from master I've got the following, just right on the first line, when tried to issue s='a[a.l-1]':

(Tests)alex@rhyme ~/work/DispatchersTests $ bpython
bpython version 0.15.dev49 on top of Python 2.7.8 /home/work/users/alex/DispatchersTests/Tests/bin/python
>>> s = 'a[a.l-1
Traceback (most recent call last):
  File "/home/work/users/alex/DispatchersTests/Tests/bin/bpython", line 9, in <module>
    load_entry_point('bpython==0.15.dev49', 'console_scripts', 'bpython')()
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsies.py", line 81, in main
    interactive=(not exec_args))
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsies.py", line 182, in mainloop
    process_event(e)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsies.py", line 140, in process_event
    repl.process_event(e)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 530, in process_event
    return self.process_key_event(e)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 671, in process_key_event
    self.add_normal_character(e)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 890, in add_normal_character
    self.cursor_offset += 1
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 1405, in _set_cursor_offset
    self.update_completion()
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/curtsiesfrontend/repl.py", line 920, in update_completion
    self.list_win_visible = BpythonRepl.complete(self, tab)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/repl.py", line 605, in complete
    history=self.history)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/autocomplete.py", line 472, in get_completer_bpython
    return get_completer(BPYTHON_COMPLETER, cursor_offset, line, **kwargs)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/autocomplete.py", line 452, in get_completer
    cursor_offset, line, **kwargs)
  File "/home/work/users/alex/DispatchersTests/Tests/lib/python2.7/site-packages/bpython/autocomplete.py", line 171, in matches
    for filename in glob(os.path.expanduser(text + '*')):
  File "/usr/lib64/python2.7/glob.py", line 27, in glob
    return list(iglob(pathname))
  File "/usr/lib64/python2.7/glob.py", line 44, in iglob
    for name in glob1(os.curdir, basename):
  File "/usr/lib64/python2.7/glob.py", line 78, in glob1
    return fnmatch.filter(names, pattern)
  File "/home/work/users/alex/DispatchersTests/Tests/lib64/python2.7/fnmatch.py", line 54, in filter
    _cache[pat] = re.compile(res)
  File "/home/work/users/alex/DispatchersTests/Tests/lib64/python2.7/re.py", line 190, in compile
    return _compile(pattern, flags)
  File "/home/work/users/alex/DispatchersTests/Tests/lib64/python2.7/re.py", line 244, in _compile
    raise error, v # invalid expression
sre_constants.error: bad character range

bpython: 5880f85
curtsies (0.2.2)

sebastinas added a commit that referenced this issue Feb 24, 2015
If we have glob.escape, use it.

Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
(cherry picked from commit 846ca4d)
@amorozov
Copy link
Author

Unfortunately these changes (up to 601df71) haven't helped with the issue

@sebastinas
Copy link
Contributor

I've re-introduced the issue in 601df71. It should be working again in 77506c1.

sebastinas added a commit that referenced this issue Feb 25, 2015
Signed-off-by: Sebastian Ramacher <sebastian+dev@ramacher.at>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants