[Calypso] [PATCH] Don't throw error messages when subdirectories are scanned
chrysn at fsfe.org
Sun Feb 28 10:14:18 PST 2016
Access to the root directory or any other non-leaf directory raises a
IOError: [Errno 21] Is a directory: '.../.config/calypso/calendars/...'
which is caught and logged as an exception, but still shows even though
just a file-oriented function is called in scan_dir with a subdirectory.
Instead, now, a debug-level log message is emitted on directories that
they are ignored for the purpose of scan_dir.
seeing tracebacks in the log is distracting during development,
especially when there is not really an error.
calypso/webdav.py | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/calypso/webdav.py b/calypso/webdav.py
index 12a9817..4d67db4 100644
@@ -287,9 +287,12 @@ class Collection(object):
- self.log.debug("New %s", filename)
+ if os.path.isdir(filename):
+ self.log.debug("Ignoring directory %s in scan_dir", filename)
+ self.log.debug("New %s", filename)
for file in self.files:
if not file.path in filenames:
self.log.debug("Removed %s", file.path)
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 819 bytes
Desc: not available
More information about the Calypso