You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
crash on line typing (TypeError: 'NoneType' object is not iterable) #726
Traceback (most recent call last):
File "/usr/bin/bpython", line 11, in <module>
load_entry_point('bpython==0.16', 'console_scripts', 'bpython')()
File "/usr/lib/python3.6/site-packages/bpython/curtsies.py", line 190, in main
exit_value = repl.mainloop()
File "/usr/lib/python3.6/site-packages/bpython/curtsies.py", line 125, in mainloop
self.process_event_and_paint(e)
File "/usr/lib/python3.6/site-packages/bpython/curtsies.py", line 89, in process_event_and_paint
self.process_event(e)
File "/usr/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py", line 584, in process_event
return self.process_key_event(e)
File "/usr/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py", line 736, in process_key_event
self.add_normal_character(e)
File "/usr/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py", line 972, in add_normal_character
self.cursor_offset += 1
File "/usr/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py", line 1544, in _set_cursor_offset
self.update_completion()
File "/usr/lib/python3.6/site-packages/bpython/curtsiesfrontend/repl.py", line 1003, in update_completion
self.list_win_visible = BpythonRepl.complete(self, tab)
File "/usr/lib/python3.6/site-packages/bpython/repl.py", line 720, in complete
self.current_line, matches, completer)
File "/usr/lib/python3.6/site-packages/bpython/repl.py", line 331, in update
self.orig_cursor_offset, self.orig_line)
TypeError: 'NoneType' object is not iterable
I'm getting a similar issue, but without requiring an external dependency. Figured I'd add my own reproduction steps. I've also included a screenshot which shows color information.
The issue seems to be occurring any time I try to tab-complete a dict key when all of the keys contain a slash and have a shared prefix. This is occurring in cases where I'm using the names of a collection of files as keys in a dict. My workaround is to not use tab completion in those cases.
I love this project and this tool by the way, use it every day. Let me know if there's anything else I can do to help with this.
Steps to Reproduce
For reference, the last sequence of keypresses was x, [, then <tab>
bpython version 0.18 on top of Python 3.5.3 /home/austin/workspace/migrations/xxx/venv/bin/python3
>>> x = {}
>>> x["a/b"] = 1
>>> x["a/c"] = 1
>>> x["a/c"] = 1
Traceback (most recent call last):
File "/home/austin/workspace/migrations/xxx/venv/bin/bpython", line 10, in <module>
sys.exit(main())
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/curtsies.py", line 191, in main
exit_value = repl.mainloop(True, paste)
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/curtsies.py", line 126, in mainloop
self.process_event_and_paint(e)
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/curtsies.py", line 90, in process_event_and_paint
self.process_event(e)
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/curtsiesfrontend/repl.py", line 595, in process_event
return self.process_key_event(e)
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/curtsiesfrontend/repl.py", line 726, in process_key_event
self.on_tab()
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/curtsiesfrontend/repl.py", line 841, in on_tab
cursor_and_line = self.matches_iter.substitute_cseq()
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/repl.py", line 333, in substitute_cseq
self.completer)
File "/home/austin/workspace/migrations/xxx/venv/lib/python3.5/site-packages/bpython/repl.py", line 353, in update
self.orig_cursor_offset, self.orig_line)
TypeError: 'NoneType' object is not iterable
I was about to open a new issue but i think it's the same as this one, so I'll post my issue here in case that can help.
I'm working with numpy arrays, and i get a really weird crash when trying to create an integer array. Basically, I can create any type of arrays just fine, except when I want to create an integer array with either 2 or 3 as numbers (yeah, it's really weird).
But if I try the exact same array as the second, but try to replace either number by either a 2 or a 3, i get a similar crash as people above :
>>> np.array([1, 6])
Traceback (most recent call last):
File "/home/julien/.venv/Actuartech_Python_intro/bin/bpython", line 8, in <module>
sys.exit(main())
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsies.py", line 201, in main
exit_value = repl.mainloop(True, paste)
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsies.py", line 121, in mainloop
self.process_event_and_paint(e)
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsies.py", line 85, in process_event_and_paint
self.process_event(e)
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 615, in process_event
return self.process_key_event(e)
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 782, in process_key_event
self.add_normal_character(e)
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1068, in add_normal_character
self.cursor_offset += 1
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1780, in _set_cursor_offset
self.update_completion()
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/curtsiesfrontend/repl.py", line 1100, in update_completion
self.list_win_visible = self.complete(tab)
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/repl.py", line 723, in complete
self.matches_iter.update(
File "/home/julien/.venv/Actuartech_Python_intro/lib/python3.8/site-packages/bpython/repl.py", line 318, in update
self.start, self.end, self.current_word = self.completer.locate(
TypeError: cannot unpack non-iterable NoneType object
Activity
AustinTSchaffer commentedon Nov 14, 2019
I'm getting a similar issue, but without requiring an external dependency. Figured I'd add my own reproduction steps. I've also included a screenshot which shows color information.
The issue seems to be occurring any time I try to tab-complete a dict key when all of the keys contain a slash and have a shared prefix. This is occurring in cases where I'm using the names of a collection of files as keys in a dict. My workaround is to not use tab completion in those cases.
I love this project and this tool by the way, use it every day. Let me know if there's anything else I can do to help with this.
Steps to Reproduce
For reference, the last sequence of keypresses was
x,[, then<tab>Working
Not Working
System
Debian 9 (
uname -a # Linux debian 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u5 (2019-08-11) x86_64 GNU/Linux)bpython 0.18
Python 3.5.3
MoburgLeGrand commentedon Mar 15, 2021
I was about to open a new issue but i think it's the same as this one, so I'll post my issue here in case that can help.
I'm working with numpy arrays, and i get a really weird crash when trying to create an integer array. Basically, I can create any type of arrays just fine, except when I want to create an integer array with either 2 or 3 as numbers (yeah, it's really weird).
What works
Doesn't work
But if I try the exact same array as the second, but try to replace either number by either a 2 or a 3, i get a similar crash as people above :
System
Ubuntu 20.04
Python 3.8.5
bpython 0.21
sebastinas commentedon Mar 16, 2021
Fixed in 34f0e70.