iterfzf
iterfzf copied to clipboard
Python crashes when result is too long
iterfzf seems to crash, when multi=True
and a lot of long-ish lines are selected.
Just thought I'd open an issue, I may look into it in the next days and will open a PR if I find a fix.
Here's a snippet to test whether it "works on your system"
import iterfzf as fzf
line_length = int(input("Input line length: ")) # use something between 50 and 100
lines = [str(i) + '+'* line_length for i in range(200)]
fzf.iterfzf(lines, multi=True) # select ~100 elements
I have glanced at the implementation but didn't find any obvious issue, though I am no expert with subprocess.
Hmm… your code does not reproduce the bug in both CPython 2.7.15 and 3.7.4 on macOS. What's your OS and Python version?
Oh sorry for leaving out that information. It was with Win10 and Python 3.7.4 and 3.8.2.
As I currently have no Windows box, it's difficult to reproduce this bug for me. 😥 It would be great if you send a patch to fix this.
I am currently working on it. Btw - would you be okay if I refactored the code in __init__.py
while I'm at it? I found it a bit unidiomatic.
If diffs become longer it would be harder to review for me… Some touches on style would be fine though.