[diffoscope] 01/01: Add comment regarding why difficult to optimise calls to lsattr
Chris Lamb
chris at chris-lamb.co.uk
Wed Dec 7 15:22:33 CET 2016
This is an automated email from the git hooks/post-receive script.
lamby pushed a commit to branch master
in repository diffoscope.
commit 79727d52cf3006d4a90a2bc1fbd2ab40c5c97622
Author: Chris Lamb <lamby at debian.org>
Date: Wed Dec 7 14:22:28 2016 +0000
Add comment regarding why difficult to optimise calls to lsattr
---
diffoscope/comparators/directory.py | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/diffoscope/comparators/directory.py b/diffoscope/comparators/directory.py
index b02589f..8e5d10b 100644
--- a/diffoscope/comparators/directory.py
+++ b/diffoscope/comparators/directory.py
@@ -64,6 +64,11 @@ class Stat(Command):
@tool_required('lsattr')
def lsattr(path):
+ """
+ NB. Difficult to replace with in-Python version. See
+ <http://stackoverflow.com/questions/35501249/python-get-linux-file-immutable-attribute/38092961#38092961>
+ """
+
try:
output = subprocess.check_output(['lsattr', '-d', path], shell=False, stderr=subprocess.STDOUT).decode('utf-8')
return output.split()[0]
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list