Ignore permission errors when stating file to edit
This commit is contained in:
parent
83ce23ff9f
commit
64e30e5299
@ -606,7 +606,7 @@ class EditCmd:
|
|||||||
self.file_name = os.path.basename(self.file_spec)
|
self.file_name = os.path.basename(self.file_spec)
|
||||||
self.file_localpath = os.path.normpath(os.path.join(self.cwd, self.file_spec))
|
self.file_localpath = os.path.normpath(os.path.join(self.cwd, self.file_spec))
|
||||||
self.is_local_file = False
|
self.is_local_file = False
|
||||||
with suppress(FileNotFoundError):
|
with suppress(OSError):
|
||||||
st = os.stat(self.file_localpath)
|
st = os.stat(self.file_localpath)
|
||||||
self.is_local_file = (st.st_dev, st.st_ino) == self.file_inode
|
self.is_local_file = (st.st_dev, st.st_ino) == self.file_inode
|
||||||
if not self.is_local_file:
|
if not self.is_local_file:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user