cheets_CTS: workaround for broken symlink file in CTS media zip.

For some reason the archive contains a broken symlink which causes
our recursive stat to fail. As a very quick workaround, catch the
exception and assume the file to be size 0.


Change-Id: I25e259ca9de77bf4adb36cf1960a75ecbd5e861c
Tested-by: Kazuhiro Inaba <>
Trybot-Ready: Kazuhiro Inaba <>
Reviewed-by: Yuichiro Hanada <>
Reviewed-by: Shuo-Peng Liao <>
(cherry picked from commit 6fd2f1e240b9e4064a595d1be8535b752abe7b2d)
Reviewed-by: Kazuhiro Inaba <>
(cherry picked from commit a146c0e9aa187a9920cf81d44aa9a3f1015817a6)
Reviewed-by: Grace Kihumba <>
Commit-Queue: Grace Kihumba <>
Tested-by: Grace Kihumba <>
diff --git a/server/cros/ b/server/cros/
index 79a4364..c1eb08a 100644
--- a/server/cros/
+++ b/server/cros/
@@ -640,8 +640,12 @@
         """Compute recursive size in bytes of directory."""
         size = 0
         for root, _, files in os.walk(directory):
-            size += sum(
-                os.path.getsize(os.path.join(root, name)) for name in files)
+            for name in files:
+                try:
+                    size += os.path.getsize(os.path.join(root, name))
+                except OSError:
+                    logging.error('Inaccessible path (crbug/793696): %s/%s',
+                                  root, name)
         return size
     def _clear_download_cache_if_needed(self):