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

FileNotFoundError: [Errno 2] #2956

Open
perchibald opened this issue Feb 28, 2024 · 1 comment
Open

FileNotFoundError: [Errno 2] #2956

perchibald opened this issue Feb 28, 2024 · 1 comment

Comments

@perchibald
Copy link

Runtime Environment

  • Operating system and version: ambian 24.2.1
  • Terminal emulator and version: xterm 378
  • Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
  • Ranger version/commit: 1.9.3
  • Locale: ru_RU.UTF-8

Current Behavior

Expected Behavior

Context

Possible Solutions

Steps to reproduce

  1. open any file

Traceback

ranger version: ranger 1.9.3
Python version: 3.11.2 (main, Mar 13 2023, 12:18:29) [GCC 12.2.0]
Locale: ru_RU.UTF-8
Current file: '/home/perchibald/.config/foot/foot.ini'

Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/ranger/core/main.py", line 201, in main
    fm.loop()
  File "/usr/lib/python3/dist-packages/ranger/core/fm.py", line 383, in loop
    ui.handle_input()
  File "/usr/lib/python3/dist-packages/ranger/gui/ui.py", line 266, in handle_input
    self.handle_key(key)
  File "/usr/lib/python3/dist-packages/ranger/gui/ui.py", line 198, in handle_key
    self.press(key)
  File "/usr/lib/python3/dist-packages/ranger/gui/ui.py", line 211, in press
    self.fm.execute_console(
  File "/usr/lib/python3/dist-packages/ranger/core/actions.py", line 271, in execute_console
    cmd.execute()
  File "/usr/lib/python3/dist-packages/ranger/api/commands.py", line 432, in execute
    return func(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ranger/core/actions.py", line 530, in move
    result = self.execute_file(selection, mode=mode)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ranger/core/actions.py", line 465, in execute_file
    return execute()
           ^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ranger/core/actions.py", line 463, in execute
    return self.rifle.execute(filenames, mode, label, flags, None)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ranger/ext/rifle.py", line 332, in execute
    for count, cmd, lbl, flgs in self.list_commands(files, mimetype):
  File "/usr/lib/python3/dist-packages/ranger/ext/rifle.py", line 303, in list_commands
    if not self._eval_condition(test, files, None):
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ranger/ext/rifle.py", line 187, in _eval_condition
    return self._eval_condition2(condition, files, label)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/ranger/ext/rifle.py", line 217, in _eval_condition2
    return bool(re.search(argument, self.get_mimetype(files[0])))
                                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/ranger/ext/rifle.py", line 261, in get_mimetype
    process = Popen(["file", "--mime-type", "-Lb", fname], stdout=PIPE, stderr=PIPE)
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/subprocess.py", line 1024, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "/usr/lib/python3.11/subprocess.py", line 1901, in _execute_child
    raise child_exception_type(errno_num, err_msg, err_filename)
FileNotFoundError: [Errno 2] Нет такого файла или каталога: 'file'

ranger crashed. Please report this traceback at:
https://github.com/ranger/ranger/issues
@perchibald perchibald changed the title FileNotFoundError: [Errno 2 FileNotFoundError: [Errno 2] Feb 28, 2024
@lkschu
Copy link

lkschu commented Apr 5, 2024

This is because you are missing the file command. It should be installed on almost all BSD and Linux distributions.

Nonetheless, this probably should be marked as a bug, since the README lists file as an optional dependency.

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