aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sos/utilities.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/sos/utilities.py b/sos/utilities.py
index a3859f1c..cf079ff5 100644
--- a/sos/utilities.py
+++ b/sos/utilities.py
@@ -263,9 +263,14 @@ class TarFileArchive(Archive):
tar_info.type = tarfile.DIRTYPE
fileobj = None
else:
- fp = open(src, 'rb')
- content = fp.read()
- fp.close()
+ try:
+ fp = open(src, 'rb')
+ content = fp.read()
+ fp.close()
+ except:
+ # files with read permissions that cannot be read may exist
+ # in /proc, /sys and other virtual file systems.
+ content = ""
tar_info.size = len(content)
fileobj = StringIO(content)