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

inquirer.Editor crashes when $EDITOR has arguments #153

Open
23Skidoo opened this issue Feb 17, 2022 · 2 comments
Open

inquirer.Editor crashes when $EDITOR has arguments #153

23Skidoo opened this issue Feb 17, 2022 · 2 comments
Labels
upstream_issue This issue is caused by an upstream package

Comments

@23Skidoo
Copy link

I have $EDITOR set to emacsclient -t -a zile, which makes inquirer.Editor crash when trying to open the editor:

>>> import inquirer
>>> inquirer.prompt([inquirer.Editor("question")])
[?] : Press <enter> to launch your editor
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/mikhail/.local/lib/python3.8/site-packages/inquirer/prompt.py", line 14, in prompt
    answers[question.name] = render.render(question, answers)
  File "/home/mikhail/.local/lib/python3.8/site-packages/inquirer/render/console/__init__.py", line 44, in render
    return self._event_loop(render)
  File "/home/mikhail/.local/lib/python3.8/site-packages/inquirer/render/console/__init__.py", line 57, in _event_loop
    self._process_input(render)
  File "/home/mikhail/.local/lib/python3.8/site-packages/inquirer/render/console/__init__.py", line 110, in _process_input
    render.process_input(ev.value)
  File "/home/mikhail/.local/lib/python3.8/site-packages/inquirer/render/console/_editor.py", line 34, in process_input
    data = editor.edit(contents=self.question.default or '')
  File "/home/mikhail/.local/lib/python3.8/site-packages/editor.py", line 101, in edit
    proc = subprocess.Popen(args, close_fds=True, stdout=stdout)
  File "/usr/lib/python3.8/subprocess.py", line 858, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.8/subprocess.py", line 1704, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] No such file or directory: 'emacsclient -t -a zile'

Starting python with EDITOR=zile python3 fixes this.

@23Skidoo
Copy link
Author

23Skidoo commented Feb 24, 2022

Appears to be a (known) issue with the python-editor package: fmoo/python-editor#11.

@Cube707
Copy link
Collaborator

Cube707 commented Aug 11, 2022

jup, this is an upstream issue we have no control over

@Cube707 Cube707 added the upstream_issue This issue is caused by an upstream package label Aug 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
upstream_issue This issue is caused by an upstream package
Projects
None yet
Development

No branches or pull requests

2 participants