-
Notifications
You must be signed in to change notification settings - Fork 892
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
Invalid escape sequence #2985
Comments
Hey @Gekiretsu it seems that this particular file is populated via the manjaro-ranger-settings package and not in this project. These seem to be compatibility issues w.r.t Python 3. Either way I ended up making the commit locally but the way to contribute to manjaro packages on a quick search seemed tedious - I'll just lay the diff right here in case u need it. Generated it via diff --git ranger/commands.py ranger/commands.py
index 60d8676..38905bf 100644
--- ranger/commands.py
+++ ranger/commands.py
@@ -1,11 +1,18 @@
from ranger.api.commands import Command
+
class paste_as_root(Command):
- def execute(self):
- if self.fm.do_cut:
- self.fm.execute_console('shell sudo mv %c .')
- else:
- self.fm.execute_console('shell sudo cp -r %c .')
+ """
+ :paste_as_root
+
+ Paste a file using superuser permissions. Use with care
+ """
+ def execute(self):
+ if self.fm.do_cut:
+ self.fm.execute_console('shell sudo mv %c .')
+ else:
+ self.fm.execute_console('shell sudo cp -r %c .')
+
class fzf_select(Command):
"""
@@ -22,17 +29,18 @@ class fzf_select(Command):
import os.path
if self.quantifier:
# match only directories
- command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
- -o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to file'"
+ command = r"find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune "\
+ r"-o -type d -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to file'" # noqa: E501
else:
# match files and directories
- command="find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune \
- -o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to filemap <C-f> fzf_select'"
- fzf = self.fm.execute_command(command, universal_newlines=True, stdout=subprocess.PIPE)
- stdout, stderr = fzf.communicate()
+ command = r"find -L . \( -path '*/\.*' -o -fstype 'dev' -o -fstype 'proc' \) -prune "\
+ r"-o -print 2> /dev/null | sed 1d | cut -b3- | fzf +m --reverse --header='Jump to filemap <C-f> fzf_select'" # noqa: E501
+ fzf = self.fm.execute_command(command, universal_newlines=True,
+ stdout=subprocess.PIPE)
+ stdout, _ = fzf.communicate()
if fzf.returncode == 0:
fzf_file = os.path.abspath(stdout.rstrip('\n'))
if os.path.isdir(fzf_file):
self.fm.cd(fzf_file)
else:
- self.fm.select_file(fzf_file)
\ No newline at end of file
+ self.fm.select_file(fzf_file) You should be able to apply this patch locally via
EDIT: I just noticed that that the errors that ur facing different from mine (the lines but the not the errors themselves) - so its more than likely that its coming from a different source - so I apologise for the confusion. But the fix remains the same and u should be able to apply the same method for ur case as well. |
Hello I've not submitted many issues before so I will try to be as thorough as possible in my explanation. I've used ranger for years as my primary file manager and just recently over the last few months I began to notice that anytime I am constantly receiving an error about a invalid escape sequence. I'm in school now and trying to teach myself python so I'm not sure at all how to fix this so any and all help I would be extremely grateful and appreciative. Below is the error that I receive every time I exit/quit ranger.
/home/chinmoku/.config/ranger/commands.py:78: SyntaxWarning: invalid escape sequence '('
command="find -L . ( -path '/.' -o -fstype 'dev' -o -fstype 'proc' ) -prune
/home/chinmoku/.config/ranger/commands.py:82: SyntaxWarning: invalid escape sequence '('
command="find -L . ( -path '/.' -o -fstype 'dev' -o -fstype 'proc' ) -prune
/home/chinmoku/.config/ranger/commands.py:134: SyntaxWarning: invalid escape sequence '('
command="find -L . ( -path '/.' -o -fstype 'dev' -o -fstype 'proc' ) -prune
/home/chinmoku/.config/ranger/commands.py:138: SyntaxWarning: invalid escape sequence '('
command="find -L . ( -path '/.' -o -fstype 'dev' -o -fstype 'proc' ) -prune \
The text was updated successfully, but these errors were encountered: