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

v1.9.3-145-g521d9f89 Trash command crash - AttributeError: 'str' object has no attribute 'path' #2199

Closed
kaykay38 opened this issue Dec 30, 2020 · 1 comment

Comments

@kaykay38
Copy link

kaykay38 commented Dec 30, 2020

Runtime Environment

  • Operating system and version: macOS Big Sur Version 11.1
  • Terminal emulator and version: iTerm2 Version 3.4.3
  • Python version: 3.9.1
  • Ranger version/commit: master v1.9.3-145-g521d9f89
  • Locale: en_US.UTF-8

Current Behavior

Crashes.

Expected Behavior

Send selected file(s) to trash

Context

Possible Solutions

Steps to reproduce

  1. space to select file
  2. dT trash command
  3. enter

Traceback

ranger version: ranger-master v1.9.3-145-g521d9f89
Python version: 3.9.1 (default, Dec 28 2020, 11:25:16) [Clang 12.0.0 (clang-1200.0.32.28)]
Locale: en_US.UTF-8
Current file: '$HOME/junk/junk4'

Traceback (most recent call last):
  File "$HOME/Downloads/ranger/ranger/core/main.py", line 203, in main
    fm.loop()
  File "$HOME/Downloads/ranger/ranger/core/fm.py", line 382, in loop
    ui.handle_input()
  File "$HOME/Downloads/ranger/ranger/gui/ui.py", line 276, in handle_input
    self.handle_key(key)
  File "$HOME/Downloads/ranger/ranger/gui/ui.py", line 206, in handle_key
    elif not DisplayableContainer.press(self, key):
  File "$HOME/Downloads/ranger/ranger/gui/displayable.py", line 272, in press
    focused_obj.press(key)
  File "$HOME/Downloads/ranger/ranger/gui/widgets/console.py", line 189, in press
    self.type_key(key)
  File "$HOME/Downloads/ranger/ranger/gui/widgets/console.py", line 215, in type_key
    self._answer_question(answer)
  File "$HOME/Downloads/ranger/ranger/gui/widgets/console.py", line 198, in _answer_question
    callback(answer)
  File "$HOME/Downloads/ranger/ranger/config/commands.py", line 760, in _question_callback
    self.fm.execute_file(files, label='trash')
  File "$HOME/Downloads/ranger/ranger/core/actions.py", line 430, in execute_file
    filenames = [f.path for f in files]
  File "$HOME/Downloads/ranger/ranger/core/actions.py", line 430, in <listcomp>
    filenames = [f.path for f in files]
AttributeError: 'str' object has no attribute 'path'

NOTE

This does not work on hover on file with the key mapping dT either.

@toonn
Copy link
Member

toonn commented Dec 30, 2020

This is being tracked in #1798 and there's a fix in #1871.

@toonn toonn closed this as completed Dec 30, 2020
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